unit 2 architectural styles and case studies | website for students | vtu notes | question papers |...

33
Unit 2 Architectural Styles and Case Studies www.bookspar.com | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS 1

Upload: karen-horton

Post on 05-Jan-2016

215 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Unit 2 Architectural Styles and Case Studies  | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS 1

www.bookspar.com | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS

1

Unit 2

Architectural Styles and Case Studies

Page 2: Unit 2 Architectural Styles and Case Studies  | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS 1

www.bookspar.com | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS

2

Architectural Style- definition

An architectural style definesVocabulary of components and

connectors types and a set of constraints on how they can be combined.

Page 3: Unit 2 Architectural Styles and Case Studies  | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS 1

www.bookspar.com | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS

3

List of Common Architectural Styles

• Pipes and Filters• Objects• Implicit invocation• Layered• Interpreters• Repositories• Process control

Page 4: Unit 2 Architectural Styles and Case Studies  | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS 1

www.bookspar.com | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS

4

Pipes and filters• Each component has a set of inputs and outputs.• A component( Filters) reads streams of data on its

inputs and produces streams of data on its outputs.• Connectors (Pipes) are responsible for data

transmission from output of one filters to input of another filters.

• Components are called filters because output begins before the entire input is consumed.

• Connectors are called pipes they allow to transmit the data.

Page 5: Unit 2 Architectural Styles and Case Studies  | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS 1

www.bookspar.com | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS

5

Page 6: Unit 2 Architectural Styles and Case Studies  | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS 1

www.bookspar.com | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS

6

Types

• Pipelines: linear sequences of filters • Bounded pipes: Restricts the amount of data

that can reside on a pipe• Typed pipes: Require that the data passed

between two filters have a well defined type.• Batch sequential system: Each filters

processes all of its input data as a single entity.

Page 7: Unit 2 Architectural Styles and Case Studies  | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS 1

www.bookspar.com | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS

7

Advantages• Easy to understand the Input and Output behaviour

of system• Supports reuse- any two filters can be hooked

together (provided they agree on the data that are being transmitted )

• Easy to maintain-• Easy to enhance- new filters can be added to existing

systems old filters can be replaced for improvement.• Permit to analyse throughput and deadlock• Supports concurrent execution

Page 8: Unit 2 Architectural Styles and Case Studies  | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS 1

www.bookspar.com | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS

8

Disadvantages• Often leads batch processing- not good for

interactive application.• Often troubled to maintain correspondences

between two separate but related streams.• Degraded performance due additional work to

each filter to parse/un-parse data .

Page 9: Unit 2 Architectural Styles and Case Studies  | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS 1

www.bookspar.com | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS

9

Data Abstraction & OO:Components & Connectors

• Components: Classes & Objects• Connectors: Method calls

Page 10: Unit 2 Architectural Styles and Case Studies  | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS 1

www.bookspar.com | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS

10

Data abstraction and Object Oriented Organization

• Data representation and associated operations are encapsulated in abstract data type or object.

• Components in this type are instances of abstract data types

• 2 important aspects• Objects preserves the integrity of representation• Representation is hidden from object.• objects interact through function and procedure

invocations.

Page 11: Unit 2 Architectural Styles and Case Studies  | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS 1

www.bookspar.com | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS

11

Advantages• Easy to change implementation without affecting others. Object

hides its representation from its clients. It is possible to change without affecting them.

• Helps to decompose the problem into collection of interacting agents.

DisadvantagesThe object must know the identity of other object in order to

interact.Side effect problem:

If A uses object B, C also uses B, then C’s effect on B is unexpected side effect to A.

Page 12: Unit 2 Architectural Styles and Case Studies  | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS 1

www.bookspar.com | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS

12

Layered Systems:Components & Connectors

• Components: Layers• Connectors: Protocols that define

how layers interact

• Components (each layer) provide service to layer above and Use service of layers below.

• Inner layers are hidden from all except the adjacent outer layer

Layer 1

Layer 2

Layer 3

Page 13: Unit 2 Architectural Styles and Case Studies  | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS 1

www.bookspar.com | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS

13

Advantages• Supports increased levels of abstraction- helps in decomposing

complex problem • Support enhancement- changes to function affect only two layers• Support reuse-Allow different implementation to same layer.

Cannot be used for all types of systemEven if a system can logically structured in layers-exhibits

performance degradation.Difficult to find right levels of abstraction.

Disadvantages

Page 14: Unit 2 Architectural Styles and Case Studies  | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS 1

www.bookspar.com | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS

14

Repositories -Black board

• Repository styles:– Central Data structure represents the current state– A collection of independent components operate on

the central data storeDatastore and Blackboard– Database-Traditional database- Transaction in input

stream triggers the process to execute– Black board-If the current state of the central data

structure is the main trigger for selecting processes to execute

Page 15: Unit 2 Architectural Styles and Case Studies  | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS 1

www.bookspar.com | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS

15

Repository: Components & Connectors• Components– Data store- central data structures

represents the current state and a collection of independent components on central data store.

– Clients, that interact with the store

• Connectors– Queries

Page 16: Unit 2 Architectural Styles and Case Studies  | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS 1

www.bookspar.com | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS

16

The blackboard

Direct access computation

memory

Blackboard(shared data)

ks1

ks7

ks2

ks8 ks3

ks4

ks5ks6

Page 17: Unit 2 Architectural Styles and Case Studies  | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS 1

www.bookspar.com | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS

17

Repository:Key Characteristics

The Architecture is centered, widely accessed data store

Data store & clients. Two main variants: Database

Passive data store, active clients that poll the database.

Blackboard Active data store that notifies each client of data

changes of interest to the client. (Clients also called knowledge sources.)

Page 18: Unit 2 Architectural Styles and Case Studies  | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS 1

www.bookspar.com | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS

18

Blackboard:The blackboard model is usually presented with 3 major parts

• The knowledge sources: Separate, independent parts of application dependent knowledge

• The blackboard data structure: Application dependent, problem solving state data. Knowledge sources can make changes to blackboard that lead incrementally to a solution to the problem.

• Control: It is driven by the state of black board. Knowledge sources responds whenever changes are made to

blackboard

Page 19: Unit 2 Architectural Styles and Case Studies  | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS 1

www.bookspar.com | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS

19

Repository: Strengths & Weaknesses

• Clients are relatively independent of each other. Data store is independent of the clients.– Scalable (i.e., new clients can be easily added)– Modifiable

• Strong dependence on data store…

Page 20: Unit 2 Architectural Styles and Case Studies  | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS 1

www.bookspar.com | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS

20

Interpreters-virtual machine

• memory

• inputs

Computation Outputs selected instructions

selected data

data access

Data (program state)

Program being interpreted

Internal interpreter

stateSimulated

Interpretation engine

Page 21: Unit 2 Architectural Styles and Case Studies  | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS 1

www.bookspar.com | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS

21

Interpreters• An interpreter includes the pseudo-program

being interpreted and the interpretation engine.

• Pseudo-program includes the program and activation record

• Interpretation engine includes definition of interpreter and current state of its execution.Interpreter engine includes:– An interpretation engine to do work– Memory –contains the psuedocode– Control state of the interpretation engine– Current state of the program being simulated.

Page 22: Unit 2 Architectural Styles and Case Studies  | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS 1

www.bookspar.com | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS

22

Process control

• Continuous processes of many kinds convert input materials to products with specific properties by performing operations on the inputs and on intermediate products.

Page 23: Unit 2 Architectural Styles and Case Studies  | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS 1

www.bookspar.com | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS

23

Process control definitionsProcess variables: Properties of the processes that can be measured;

Controlled variable :Process variable whose value the system is intended to control

Input variable: Process variable that measures an input to the process

Manipulated variable :Process variable whose value can be changed by the controller

• Set point: The desired value for a controlled variable

• Open loop system: System in which information about process variables is not used to adjust the system

• Closed loop system :systems in which information about process variables is used to manipulate a process variable to compensate for variations in process variables and operating conditions

• Feedback control system: The controlled variable is measured, and the result is used to manipulate one or more of the process variables

Page 24: Unit 2 Architectural Styles and Case Studies  | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS 1

www.bookspar.com | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS

24

Process Control: Example

Open-loop temperature control.

Page 25: Unit 2 Architectural Styles and Case Studies  | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS 1

www.bookspar.com | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS

25

Process Control: Example

Closed-loop temperature control.

Page 26: Unit 2 Architectural Styles and Case Studies  | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS 1

www.bookspar.com | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS

26

Process control..

Page 27: Unit 2 Architectural Styles and Case Studies  | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS 1

www.bookspar.com | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS

27

Process control..

Page 28: Unit 2 Architectural Styles and Case Studies  | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS 1

www.bookspar.com | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS

28

A software paradigm for Process control

An architecture style for software that controls continuous processes can be based on the process control model• Computational elements– Separate the process of interest from control policy– Process definition: Mechanism for manipulating process variables. – Control algorithm-for deciding how to manipulate process variables.• Data elements– Process variable, set points, and sensors.• The control loop paradigm– Establishes the relation, the control algorithm exercises.– It collect information and tunes the process variable to get the

intended state.

Page 29: Unit 2 Architectural Styles and Case Studies  | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS 1

www.bookspar.com | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS

29

Distributed processes• Common form of distributed system: Client –

server organization• In this case a server represents a process that

provides services to other processes(clients) .• Sever does not know in advance the identities or

number of clients that will access it at run time• Clients know the server identity and access it.

Page 30: Unit 2 Architectural Styles and Case Studies  | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS 1

www.bookspar.com | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS

30

Main program / subroutine

• Main program acts as the driver for the subroutine

• Provide a control loop for sequencing through the subroutine in some order.

Page 31: Unit 2 Architectural Styles and Case Studies  | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS 1

www.bookspar.com | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS

31

Domain specific software architecture

• Provide an organizational structure suited for particular applications –avionics, command and control, vehicle-management systems.

Page 32: Unit 2 Architectural Styles and Case Studies  | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS 1

www.bookspar.com | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS

32

State transition systems

• These systems are defined in terms of a set of states and a set of named transitions that move a system from one state to another.

Page 33: Unit 2 Architectural Styles and Case Studies  | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS 1

www.bookspar.com | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS

33

Heterogeneous ArchitectureArchitectural style can be combined in several ways • Hierarchical– A component of a system organized in one architectural style may

have different internal structure.– Example: Unix Pipeline

• Combining styles to permit a single component may use mixture of architectural connectors.– Example: A component might access a repository through part of

its interface , but interact through pipes.• Combine styles to completely elaborate one level of

architectural description in a completely different architectural style.