Unit 2 Architectural Styles and Case Studies | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS 1
Architectural Style- definition An architectural style defines Vocabulary of components and connectors types and a set of constraints on how they can be combined. | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS 2
List of Common Architectural Styles Pipes and Filters Objects Implicit invocation Layered Interpreters Repositories Process control | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS 3
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. | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS 4
5
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. | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS 6
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 | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS 7
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. | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS 8
Data Abstraction & OO : Components & Connectors Components: Classes & Objects Connectors: Method calls | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS 9
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. | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS 10
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. | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS 11 Disadvantages The 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.
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 | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS 12 Layer 1 Layer 2 Layer 3
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. | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS 13 Cannot be used for all types of system Even if a system can logically structured in layers-exhibits performance degradation. Difficult to find right levels of abstraction. Disadvantages
Repositories -Black board Repository styles: – Central Data structure represents the current state – A collection of independent components operate on the central data store Datastore 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 | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS 14
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 | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS 15
The blackboard Direct access computation memory | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS 16 Blackboard (shared data) ks1 ks7 ks2 ks8 ks3 ks4 ks5ks6
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.) | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS 17
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 | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS 18
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… | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS 19
Interpreters-virtual machine memory inputs Computation Outputs selected instructions selected data data access | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS 20 Data (program state) Program being interpreted Internal interpreter state Simulated Interpretation engine
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. | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS 21
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. | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS 22
Process control definitions Process variables: P roperties of the processes that can be measured; Controlled variable :P rocess variable whose value the system is intended to control Input variable: Process variable that measures an input to the process Manipulated variable :P rocess 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 | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS 23
Process Control : Example Open-loop temperature control. | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS 24
Process Control: Example Closed-loop temperature control. | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS 25
Process control.. | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS 26
Process control.. | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS 27
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. | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS 28
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. | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS 29
Main program / subroutine Main program acts as the driver for the subroutine Provide a control loop for sequencing through the subroutine in some order. | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS 30
Domain specific software architecture Provide an organizational structure suited for particular applications –avionics, command and control, vehicle-management systems. | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS 31
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. | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS 32
Heterogeneous Architecture Architectural 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. | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS 33