written 8.5 years ago by | • modified 8.5 years ago |
Mumbai University > Computer engineering > Sem 7 > Software Architecture.
Marks: 10 M
Year: May 12
written 8.5 years ago by | • modified 8.5 years ago |
Mumbai University > Computer engineering > Sem 7 > Software Architecture.
Marks: 10 M
Year: May 12
written 8.5 years ago by |
Pipe and Filter style
There are two frameworks for this style-
The Standard I/O framework:
Standard I/O (stdio) framework used in C programming language. Each process is a filter where it reads input from standard input (stdin) and writes output to standard output (stdout).Low and high level operations like getchar(…), putchar(…) which move one character at a time and printf(…) and scanf(…) which move and format entire strings are available.
Features:
Platform support:- Available with most, if not all, implementations of C programming language Operates somewhat differently on OS’s with no concurrency (e.g., MS-DOS)
Fidelity:- Good support for developing P&F applications, but no restriction that apps have to use this style
Matching assumptions:- Filters are processes and pipes are implicit. In-process pipe & filter applications might require modifications
Efficiency:- Whether filters make maximal use of concurrency is partially up to filter implementations and partially up to the OS
The java.io Framework:
Standard I/O framework used in Java language. It is Object-oriented and can be used for in-process or inter-process pipe&filter applications. All stream classes derive from InputStream or OutputStream. Distinguished objects (System.in and System.out) for writing to process’ standard streams are available. Additional capabilities (formatting, buffering) are provided by creating composite streams (e.g., a Formatting-Buffered-InputStream).
Features:
Platform support:- Available with all Java implementations on many platforms Platform-specific differences abstracted away
Fidelity:- Good support for developing P&F applications, but no restriction that apps have to use this style
Matching assumptions:- Easy to construct intra- and inter-process P&F applications Concurrency can be an issue; many calls are blocking
Efficiency:- Users have fine-grained control over, e.g., buffering Very high efficiency mechanisms (memory mapped I/O, channels) not available (but are in java.nio)
C2 architectural style
There are two frameworks for this style-
The Lightweight C2 framework:
The first C2 framework implemented in java is known as the lightweight C2 framework. It is implemented in only 16 classes, 3000 lines of code. To develop an application using this framework, developers create component and connector implementations as sub classes of the component or Connector abstract base classes. The component and connector classes communicate with each other using messages which are instances of Request and Notification classes.
Features:
Platform support:- Available with all Java implementations on many platforms
Fidelity:- Assists developers with many aspects of C2 but does not enforce these constraints Leaves threading and queuing policies up to individual elements
Matching assumptions:- Component/connector main classes must inherit from distinguished base classes All messages must be in dictionary form
Efficiency:- Lightweight framework; efficiency may depend on threading and queuing policy implemented by individual elements
The Flexible C2 framework:
It incorporates more aspects of the architectural style directly into the framework. It is implemented in 73 classes, 8500 lines of code. It uses interfaces rather than base classes. Threading policy and message queuing for application is pluggable.
Features:
Platform support:- Available with all Java implementations on many platforms
Fidelity:- Assists developers with many aspects of C2 but does not enforce these constraints Provides several alternative application-wide threading and queuing policies
Matching assumptions:- Component/connector main classes must implement distinguished interfaces Messages can be any serializable object
Efficiency:- User can easily swap out and tune threading and queuing policies without disturbing remainder of application code