Please Answer this question
You
are asked to use pipes & filters architectural pattern to design software
architectures for the following 2 programs.
a)
The
program A inputs a sequence of numbers, e.g. 3, 5, 7, 9, 4, 5, 8, and outputs 8
times of each of the input numbers, e.g. 24, 40, 56, 72, 32, 40, 64 …
b)
The
program B inputs one number k and outputs a sequence of k times 2i
where i = 1, 2, 3, 4, 5, 6, … For example, when input is 3, the program outputs
6, 12, 24, 48, 96, …
For the architecture of each program, describe its module view with a
UML class diagram and component-connector view with a UML composite structure
diagram. Please note that for the two architectures, their module views must be
same, but their component-connector views can be different. Hint: create a
"doubler" filter class.
In the class diagram, according to pipes & filters architectural
pattern, you should design the following classes: DataSource, DataSink, Filter,
and Pipe. For each class, give name(s) of its operation(s). No attributes and
operation signatures are needed. You should describe multiplicity for each
association relationship in the diagram. No interfaces are needed.
In the composite structure diagrams, based on the class diagram, you
should design components, component ports, and connectors between ports of two
components. For each connector, give its role and connector type.