Presentation is loading. Please wait.

Presentation is loading. Please wait.

Software Architectural Style By the end of this lecture, you will be able to: list various software architectural styles describe advantages and disadvantages.

Similar presentations


Presentation on theme: "Software Architectural Style By the end of this lecture, you will be able to: list various software architectural styles describe advantages and disadvantages."— Presentation transcript:

1

2 Software Architectural Style By the end of this lecture, you will be able to: list various software architectural styles describe advantages and disadvantages of call-and-return and data-flow styles (and substyles) be able to select and apply one of these styles

3 2 Architectural style (Buildings) 18th Century Georgian Architecture “Old Corner Bookstore” Boston MA Early Gothic Architecture Notre Dame, Paris

4 3 Styles and patterns Identifying styles (and patterns) can help codify and share knowledge/expertise Architectural Styles [Shaw and Garlan, Software Architecture, Prentice Hall 96] Design Patterns [Gamma, Helm, Johnson, Vlissides, Design Patterns, Addison Wesley 95] [Buschmann et. Al, Pattern-oriented Software Architecture: A System of Patterns, John Wiley & Sons 96] Code Patterns [Coplien, Advanced C++ Programming Styles and Idioms, Addison-Wesley 91]

5 4 Architectural styles A style consists of: a set of component types (e.g., process, procedure) that perform some function at runtime a topological layout of the components showing their runtime relationships a set of semantic constraints a set of connectors (e.g., data streams, sockets) that mediate communication among components Styles provide a framework on which to base design From Chapter 5, Software Architecture in Practice, p. 94

6 5 A catalog of architectural styles Today Next Time

7 6 Call-and-Return style Goal: achieve modifiability and scalability Substyles: Main-program-and-subroutine Decompose program hierarchically. Each component gets control and data from its parent. Remote procedure call Components are distributed across a network. Remote call is between two computers, but otherwise looks like a procedure call. Object-oriented or abstract data type Layered

8 7 Object-oriented (ADT) substyle Objects help achieve modifiability by encapsulating internal secrets from environment Access to objects is only through methods (constrained forms of procedure calls) Object-oriented paradigm is distinguished from ADT by inheritance and polymorphism

9 8 Example: cruise control system A cruise-control system exists to maintain the speed of a car, even over varying terrain, when turned on by the driver. When the brake is applied, the system must relinquish speed control until told to resume. The system must also steadily increase or decrease speed to reach a new maintenance speed when directed to do so by the driver. From Model Problems in Architecture, Shaw

10 9 Cruise control: Input/output System on/off: If on, cruise-control should maintain the car speed. Engine on/off: If on, denotes car engine is turned on; cruise-control is only active if the engine is on. Pulses from wheel: A pulse is sent for every revolution of the wheel. Accelerator: Indication of how far the accelerator has been pressed. Brake: On when the brake is pressed; cruise-control temporarily reverts to manual control if the brake is pressed. Increase/Decrease Speed: Increase or decrease the maintained speed; only applicable if the cruise-control system is on. Resume: Resume the last maintained speed; only applicable if the cruise- control system is on. Clock: Timing pulse every millisecond. Throttle: Digital value for the engineer throttle setting.

11 10 Layered substyle Goals: modifiability and portability Optimally, each layer communicates only with its neighbors Sometimes, must layer bridge for performance: decreases benefits of style Core Basic Utility Subsystem User Interface

12 11 Layered substyle: Example Outline of a design used on a mobile robot Level 1 is robot control Levels 2-3 deal with input from real world Level 4 manages robot’s view of world Level 5 manages robot navigation Levels 6-7 schedule and plan robot’s activities Top-level is UI and supervisory Supervisor Global Planning Control Navigation Real-world Modelling Sensor Integration Sensor Interpretation Robot Control Environment

13 12 Data-Flow style Data-flow Batch Sequential Pipes and Filters components are independent programs each step runs to completion before the next starts each batch of data is transmitted as a whole between steps Classic data-processing approach Goals: achieve reuse and modifiability

14 13 Pipe-and-Filter substyle Incremental transformation of data by successive components Filters transform data using little contextual information and retain no state between instantiations Pipes are stateless and are used to move streams of data between filters A pipe’s source end connects to a filter’s output port; sink end connects to filter’s input port

15 14 Pipe-and-Filter substyle... Pipes and filters run non-deterministically until no more computations or transmissions are possible +Simple to reason about, eases maintenance, enhances reuse, can easily enhance performance by parallelizing or distributing - Interactive apps are difficult, filters can’t cooperate to solve a problem, performance is often bad

16 15 Cruise control: Pipe-and-Filter style Design a pipe-and-filter solution given the following filters: System State: determines overall status. If engine on and cruise control on, then On, else Off Clock Pulses: Transforms pulses to numeric value Calculate Desired Speed (CDS): determine current desired speed based on system state, whether brake is applied, and cruise state Calculate Throttle Split: takes an input and creates two output streams

17 16 Heterogeneous Use Systems are generally built from multiple styles Three kinds of heterogeneity: Locationally heterogeneous: run-time structures reveal different styles in different areas Hierarchically heterogeneous: a component of one style, when decomposed is structured according to another style Simultaneously heterogeneous: different styles depending on point of view


Download ppt "Software Architectural Style By the end of this lecture, you will be able to: list various software architectural styles describe advantages and disadvantages."

Similar presentations


Ads by Google