16
Architecture styles • Pipes and filters • Object-oriented design • Implicit invocation • Layering • Repositories

Architecture styles Pipes and filters Object-oriented design Implicit invocation Layering Repositories

Embed Size (px)

Citation preview

Page 1: Architecture styles Pipes and filters Object-oriented design Implicit invocation Layering Repositories

Architecture styles

• Pipes and filters

• Object-oriented design

• Implicit invocation

• Layering

• Repositories

Page 2: Architecture styles Pipes and filters Object-oriented design Implicit invocation Layering Repositories

Pipes and filters

• Two components:– Pipe streams of data for input and output– Filter transforms data from input to output

• Filters are independent– Not aware of the existence or functions of the

system’s other filters

Page 3: Architecture styles Pipes and filters Object-oriented design Implicit invocation Layering Repositories

Pipes and filters

Page 4: Architecture styles Pipes and filters Object-oriented design Implicit invocation Layering Repositories

Pipes and filters

• Advantages– Designers can understand the entire system’s effects on

inputs and output as the composition of filters– Since any two filters can be linked together, the filters

can be reused easily on other systems– System evolution is simple, because new filters can be

added and old filters removed with relative ease– Because of filter independence, designers can simulate

system behaviour and analyse system properties (such as throughput)

– Allow concurrent execution of filters

Page 5: Architecture styles Pipes and filters Object-oriented design Implicit invocation Layering Repositories

Pipes and filters

• Disadvantages– Encourage batch processing, which is not good

for handling interactive applications– When two data streams are related, the system

must maintain a correspondence between them– Independence of filters means that some filters

may duplicate preparatory functions that are performed by filters, thereby affecting performance and making code quite complex

Page 6: Architecture styles Pipes and filters Object-oriented design Implicit invocation Layering Repositories

Object-Oriented Design

• This design builds components around abstract data types

• It has two important characteristics:– Object must preserve the integrity of the data

representation– Data representation must be hidden from other

objects (encapsulation)

Page 7: Architecture styles Pipes and filters Object-oriented design Implicit invocation Layering Repositories

Object-Oriented Design

• Advantages– Encapsulation makes it easy to change the

implementation without greatly disturbing the rest of the system

– Combining object access routines with the data manipulated by them, encourages designers to decompose the underlying problem into a collection of interacting agents

• Disadvantages– One object must know the identity of the other objects

in order for them to interact

Page 8: Architecture styles Pipes and filters Object-oriented design Implicit invocation Layering Repositories

Implicit Invocation• This design is event-driven and based on the notion of

broadcasting– Instead of invoking a procedure directly, a component announces that

one or more events have taken place– Other components can associate a procedure with those events

registering a procedure– System invokes all such registered procedures

• Data exchanged must be done through a shared data in a repository

• In general, when a component or system announces an event, it does not know which components will be affected by the event– For this reason there is usually some explicit invocation as well

Page 9: Architecture styles Pipes and filters Object-oriented design Implicit invocation Layering Repositories

Implicit Invocation

• Advantage– Especially useful for reusing design component

from the other systems

• Disadvantage– Lack of assurance that a component will

respond to an event• The dependence on the context and sequence of

events makes it very difficult to test the system and check for correctness

Page 10: Architecture styles Pipes and filters Object-oriented design Implicit invocation Layering Repositories

Layering

• Layers are hierarchical• Each layer provides services to the one outside it

and acts as a client to the layer inside it– In some systems, each layer has to access some or all of

the other layers

– In other systems, a given layer has access only to adjacent layers

• Design includes the protocols that explain how each pair of layers will interact

Page 11: Architecture styles Pipes and filters Object-oriented design Implicit invocation Layering Repositories

Layering

Page 12: Architecture styles Pipes and filters Object-oriented design Implicit invocation Layering Repositories

Layering

• Advantages– Each layer can be considered to be an increasing level

of abstraction, and the designers can use the layers to decompose a problem into a sequence of more abstract steps

– Because there are restrictions on which layers interact with other layers, it is relatively easy to add or modify a layer as the need arises.

• Usually such changes affect only the two adjacent layers

Page 13: Architecture styles Pipes and filters Object-oriented design Implicit invocation Layering Repositories

Layering

• Disadvantages– Not easy to structure a system in layers, as

multiple layers of abstraction are not always evident when we examine a set of requirements

– Even when a layered design is created, the system performance may suffer from the extra coordination among the layers

Page 14: Architecture styles Pipes and filters Object-oriented design Implicit invocation Layering Repositories

Repositories

• Has two types of components– A central data store– A collection of components that operate on it to store,

retrieve, and update information

• The challenge in this design, lies in deciding how the two types of components will interact

• Traditional databasethe transactions, in the form of an input stream, trigger process execution

• Blackboardthe central store controls the triggering of the process

Page 15: Architecture styles Pipes and filters Object-oriented design Implicit invocation Layering Repositories

Repositories

Page 16: Architecture styles Pipes and filters Object-oriented design Implicit invocation Layering Repositories

Repositories

• Advantage– Its openness as data representation is often

made available to several vendors so that they can build tolls to access the repository

• Disadvantage– Shared data must be in a form acceptable to all

knowledge sources, even if the knowledge sources themselves are radically different