Showing posts with label Software architecture. Show all posts
Showing posts with label Software architecture. Show all posts

Thursday, 16 August 2012

Repository Architectural Style

Repository architectural style is data centered style, which allows user interaction for data processing. This style shows two main entities. First one is central data structure which represents the current state of system and second one is independent entity which operates on central data structure. Second entity called clients have full control over logic flow. Means clients can read data from central data structure and write data to central data structure. Different clients may have different interfaces and privileges on central data structure.

Central repository may be our normal database or any kind of data store. Central repository is also known as blackboard and clients are called as knowledge sources. Knowledge source is independent entity of application. These knowledge sources communicate with each other through blackboard only. Here is diagram representing whole structure,




Here each knowledge source will change the data at blackboard which will lead to solution. Each knowledge source will be triggered by the current state of blackboard.

This type of style is mainly used in the applications where complex signaling system is required. We can also use such a style in applications involving shared data access and loosely coupled agents.

In java we can use threading and synchronized block to implement this style.

Monday, 13 August 2012

Pipes & Filters Architectural Style

Pipes & filter is one of the architectural styles. An architectural style defines a vocabulary of components and connector types, and a set of constraints on how they can be combined.

Pipes and filter style shows components and filters connecting those components. Each component shows set of inputs and set of outputs. Each component performs some local processing on input to produce output. Here output is generated incrementally, so that output begins before input is consumed. In this style components are called as filters and connectors are called as pipes. 

Invariants: 
1.  Filter must be independent entity.

      2. Filter should not know the identity of neighbors. Means it should not share any of its state with other components.

This style generally shows two types of pipes, 
1.  Bounded  pipes:
Such pipes restrict the amount of data that can reside on pipe.
      2. Typed pipe:
Such pipes want well formatted or typed data. Means they will pass data between two filters if an only if it is well formatted or typed.


Advantages:
     1. Gives over all input output behavior of the system.
     2. Such systems are easy to maintain.
     3. Reuse is possible.
     4. Supports concurrent execution.
 

Disadvantages:
      1.  Not good for interactive systems.
      2.  Not good for incremental display updates.
      3.  It is very difficult to maintain correspondence between two or more separate but related streams.
   
      Applications:
One of the best the application is shell commands. Where output of one command can be passed to another command.



In this style you can give feedback too.