Question: ### Ex 2 Build a real - time data processing system that receives large amounts of data from multiple sources, processes it in real -
### Ex
Build a realtime data processing system that receives large amounts of data from multiple sources, processes it in realtime, and stores it in a database. The data can be of different types eg text, audio, video and needs to be processed in different ways depending on the type.
Use the factory method pattern to create different data processing modules for each data type. The system should be easily expandable to add new data types and processing modules in the future.
Here are the steps to complete the exercise:
Define the Data class that will serve as the base for all data types. It should have the following properties:
Type string
Content object
Define an abstract DataProcessor class that will serve as the factory for creating data processing modules. It should have the following abstract method:
createDataProcessorData data
Create concrete DataProcessor classes for each data type eg TextDataProcessor, AudioDataProcessor, VideoDataProcessor that extend the DataProcessor class and implement its createDataProcessor method to create a specific data processing module. Each processor should process the data in a unique way depending on its type.
Define the Content objects that will be used to populate the corresponding property of the Data class for each data type.
Create a DataProcessorCreator class that will use the DataProcessor to process the data. It should have the following methods:
setProcessorDataProcessor
processDataData datacalls the createDataProcessor method of the processor to process the data
Use the DataProcessorCreator and the concrete processors to process the incoming data in realtime and store it in the database.
Implement a system for allowing the addition of new data types and processing modules in the future, by creating new concrete processors that extend the DataProcessor class and implement its createDataProcessor method to create a specific data processing module.
Note: You can use any programming language you are comfortable with to complete this exercise.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
