Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 14 Software Architecture

Similar presentations


Presentation on theme: "Chapter 14 Software Architecture"— Presentation transcript:

1 Chapter 14 Software Architecture

2 Architectural Patterns
From Mud to Structure Layers pattern Pipes and Filters pattern Blackboard pattern Distributed Systems Broker pattern Interactive Systems Model-View-Controller pattern Presentation-Abstraction-Control pattern Adaptable Systems Reflection pattern Microkernel Pattern

3 From Mud to Structure Layers pattern Pipes and Filters pattern
Decompose the system into groups of subtasks with different levels of abstraction Pipes and Filters pattern Provide a structure for systems that process a stream of data. Each processing step is a filter, and data is passed through pipers that connect filters. Blackboard pattern For problems for which no deterministic solution strategies are known. Several subsystems assemble their knowledge to build a solution or partial solution

4 Layers Pattern Context Problem Solution Known uses
A large system that requires decomposition Problem A system whose dominant characteristics is a mix of low- and high-level issues, where high-level operations rely on low-level ones. Solution Structure the system into a number of layers and layer J may only use services of its immediate next lower-level layer J-1. Known uses Virtual machines API Information systems (presentation, app. Logic, domain, database) Windows NT (system services, resource manager, kernel, HW abstraction layer)

5 Layers Pattern - example
FTP protocol FTP TCP IP Ethernet FTP TCP IP Ethernet TCP protocol IP protocol Ethernet protocol Physical connection

6 Pipes and Filters Pattern
Context Processing data streams Problem A system that must process or transform a stream of input data. Solution Divide the function of the system into several sequential processing steps (filters), which are connected by the data flow (pipes) through the system, the output of one step is the input of another. Known uses Unix (e.g., ps –axu | grep key | more)

7 Blackboard Pattern Context Problem Solution Known uses
A immature domain in which no closed approach to a solution is known or feasible Problem Problems that do not have a feasible deterministic solution for the transformation of raw data into high-level data structures, such as diagrams. Solution Design a collection of independent programs that work cooperatively on a common data structure. A human user may determine which programs can access the blackboard and reject or accept a solution Known uses HEARSAY – II speech recognition system

8 Distributed Systems Microkernel Pattern Broker Pattern
It separate a minimal functional core from extended functionality as a microkernel in order to adapt to changing system requirements. Clients and servers may run on top of the microkernel components. Broker Pattern Structure distributed software systems with decoupled components and a broker is responsible for coordinating communications between them

9 Broker Pattern Context Problem Solution
A distributed and possibly heterogeneous system wit independent cooperating components Problem Building a complex software system as a set of decoupled and inter-operating components, rather than as a monolithic application. Solution Introduce a broker component to achieve better decoupling of clients and servers. Servers register with the broker, and make their services available to clients through method interfaces, clients access the functionality of servers by sending requests via the broker.

10 Broker Pattern - Structure
findServer FindClient Forward_req Forwared_resp Reg_service Client-side proxy Pack_data unpack)_data Send_request Server-side proxy Pack_data unpack)_data Send_request Server Initialize runService UseBrokerAPI Client callServer startTask callBrokerAPI Bridge packData unpackData forwardMsg transmitMsg

11 Broker Pattern - Structure
Clients Applications that access the services of the servers A client forwards requests to the broker and receives responses from the broker Broker A messenger that forwards requests to the proper server and forward responses from servers back to clients. A broker must have means of locating the received of a request. It also offers API to clients and servers including registration and method calling Client-side proxy A layer between clients and the broker to provide transparency in that a remove object appears to the client as a local one

12 Broker Pattern - Structure
Server-side proxy Generally analogous to client-side proxy Servers A server implements objects that expose their functionality through interfaces that consist of operations and attributes. A server registers its services and itself to the broker. Bridges Optional components used to hide implementation details when two brokers interoperate. When the system is on a heterogeneous network, a bridge may be used to hide those system-specific details.

13 Interactive Systems Model-view-controller pattern
Decompose an interactive system into model, view, and controller three components. The model contains the core functionality and data. Views display information to the user. Controllers handle user input. A change propagation mechanism ensures consistency between the interface and the model Presentation-abstraction-control pattern Defines a structure in the form of a hierarchy of cooperating agents. Every agent is responsible for a specific aspect of the system’s functionality and it consists of three components: presentation, abstraction, and control.

14 MVC Pattern Context Problem Solution Known uses
Interactive applications with a flexible user interface Problem User interfaces are prone to changes. When the user interface is tightly interwoven with the functional core, it becomes very expensive to build such a system Solution Divide an interactive system into three areas: processing, output, and input, which are encapsulated in the Model, View, and Controller, respectively. Known uses Smalltalk Visual C++ framework – Document-View - MFC ET++

15 MVC Pattern - Structure
Model coreData Attach(observer) Detach(observer)notify getdata Send_request observers Observer Update View myModel myController Initialize(model) Activate Display update Controller myModel myView Initialize(model, view) handleEvent update

16 MVC Pattern - Structure
Model The model component of MVC encapsulates core data and functionality, independent of specific output representation or input behavior Views and controllers View components display information to the user. Each view may have an associated controller component to receive input, which is then translated to service requests for the model or view. Change propagation The Observer design pattern may be employed. Model: the observable Views: observers

17 Presentation-Abstraction-Control
Context Development of an interactive system with the help of agents Problem A system consists of a set cooperating agents. Each agent is responsible for one particular task Solution Structure the application as a tree-like hierarchy of PAC agent. Each agent is responsible for one aspect of the system’s functionality

18 Presentation-Abstraction-Control
Each agent consists of three components: presentation, abstraction, and control The presentation component provides the visible behavior of the agent The abstraction component maintains the data model and operations on the data model Control component connects the presentation and abstraction and communication with other agents. The top level agent provides the functional core of the system Bottom level agents represent self-contained semantic concepts on which the user can act, such as a spreadsheet Intermediate level agents represent either combinations of, or relationships between, low level agents. Known uses Network Traffic Management Mobile Robot

19 PAC Pattern - Structure
Repository Data sendMsg receiveMsg Spreadsheet electionData sendMsg receiveMsg Open Close enterData ErrorHandler errorData sendMsg receiveMsg displayError handleError ViewMediator viewData sendMsg receiveMsg openView closeView BarChart chartData sendMsg receiveMsg open close PieChart pieData sendMsg receiveMsg open close

20 PAC Pattern - Structure
ViewMediator Agent Abstraction chartData setChartData getChartData Control interactionData sendMsg receiveMsg getData Presentation presentData Update Open Close Zoom print BarChart Agent

21 Adaptable Systems Microkernel pattern Reflection pattern
Separate a minimal functional core from extended functionality and customer-specific parts. Reflection pattern Provides a mechanism for changing structure and behavior of software systems dynamically. Supports the modification of fundamental concepts, such as type structures and function call mechanism.

22 Microkernel Pattern Context Problem Solution Known Uses
The development of several applications that use similar programming interfaces that build on the same core functionality Problem Develop software for an application domain that needs to cope with a broad spectrum of similar standards and technologies. Solution Encapsulate the fundamental services of you application platform in a microkernel component Known Uses The Mach operating system The Amoeba operating system Windows NT

23 Microkernel Pattern – Structure
Implements central services such as communication facilities or resource handling. Internal servers Extends the functionality provided by the microkernel It represents a separate components providing additional functionality. It encapsulates some dependencies on the underlying hardware External server Also known as a personality, is a component that uses the microkernel for implementing its own view of the underlying application domain. clients An application that is associated with exactly one external server. Adapter Represent these interfaces between clients and their external servers and allow clients to access the services in a portable manner.

24 MVC Pattern - Structure
External Server receiveRequest dispatchRequest ExecuteService Microkernel executeMechanism findReceiver createHandler sendMsg callInternalServer Internal Server executeService receiveRequest Adapter callService createRequest Client doTask

25 Reflection Pattern Context Problem Solution
Building systems that support their own modification Problem Software systems must be open to modifications in response to changing technology and requirements. Solution Make the software self-aware, and make selected aspects of its structure and behavior accessible for adaptation and change The architecture is split into two major parts: a meta level and a base level.

26 Reflection Pattern Meta level Base level
Provides a self-representation of the software to give it knowledge of its own structure and behavior, and consists of so-called meta-objects Base level Defines the application logic. Its implementation uses the meta-objects to remain independent of those aspects that likely to change,

27 Reflection Pattern - Example
Persistent objects in C++ C++ does not support persistence for objects How to store objects to a file and read them? Solution 1: each class has its own way of storing its structure. Solution 2: using Reflection pattern The standard class type_info provides reflective capability – we can identify and compare types. Use type_info (offsets, sizes of data types, and data members) to read and store objects.


Download ppt "Chapter 14 Software Architecture"

Similar presentations


Ads by Google