Sunteți pe pagina 1din 170

Software Architecture

Dr Ljubomir Lazi , Docent


New wine in old bottles? (i.e., software architecture global design?, architect designer)

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

Overview
What is it, why bother? Architecture Design Viewpoints and view models Architectural styles Architecture asssessment Role of the software architect

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

The Role of the Architect

requirements client, users assess architect creates

solutions developers assess

visualises

prescribes

appearance, behaviour

architectural design

construction, co-operation

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

Pre-architecture life cycle

stakeholders (few)

requirements

quality

agreement

development

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

Characteristics
Iteration mainly on functional requirements Few stakeholders involved No balancing of functional and quality requirements

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

Adding architecture, the easy way

stakeholders (few)

requirements

quality

agreement architecture detailed design implementation development

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

Architecture in the life cycle


stakeholders (many)

requirements

quality

architecture agreement development

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

Characteristics
Iteration on both functional and quality requirements Many stakeholders involved Balancing of functional and quality requirements

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

Why Is Architecture Important?


Architecture is the vehicle for stakeholder communication Architecture manifests the earliest set of design decisions
Constraints on implementation Dictates organizational structure Inhibits or enable quality attributes

Architecture is a transferable abstraction of a system


Product lines share a common architecture Allows for template-based development Basis for training

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

Where did it start?


1992: Perry & Wolf 1987: J.A. Zachman; 1989: M. Shaw 1978/79: David parnas, program families 1972 (1969): Edsger Dijkstra, program families 1969: I.P. Sharp @ NATO Software Engineering conference: I think we have something in addition to software engineering [..] This is the subject of software architecture. Architecture is different from engineering.
Kljent Server Sistemi (Softverske Arhitekture) @ 2007

Doc. Dr Ljubomir Lazi

10

Software architecture, definition (1)


The architecture of a software system defines that system in terms of computational components and interactions among those components. (from Shaw and Garlan, Software Architecture, Perspectives on an Emerging Discipline, PrenticeHall, 1996.)

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

11

Software Architecture
statement procedure module (design) pattern architecture

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

12

Software Architecture, definition (2)


The software architecture of a system is the structure or structures of the system, which comprise software elements, the externally visible properties of those elements, and the relationships among them. (from Bass, Clements, and Kazman, Software Architecture in Practice, SEI Series in Software Engineering. Addison-Wesley, 2003.)

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

13

Software Architecture
Important issues raised in this definition:
multiple system structures; externally visible (observable) properties of components.

The definition does not include:


the process; rules and guidelines; architectural styles.

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

14

Architectural Structures
module structure conceptual, or logical structure process, or coordination structure physical structure uses structure calls structure data flow control flow class structure

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

15

Software Architecture, definition (3)


Architecture is the fundamental organization of a system embodied in its components, their relationships to each other and to the environment and the principles guiding its design and evolution (from IEEE Standard on the Recommended Practice for Architectural Descriptions, 2000.)

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

16

Software Architecture
Architecture is conceptual. Architecture is about fundamental things. Architecture exists in some context.

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

17

Other points of view


Architecture is high-level design Architecture is overall structure of the system Architecture is the structure, including the principles and guidelines governing their design and evolution over time Architecture is components and connectors

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

18

Software Architecture & Quality


The notion of quality is central in software architecting: a software architecture is devised to gain insight in the qualities of a system at the earliest possible stage. Some qualities are observable via execution: performance, security, availability, functionality, usability And some are not observable via execution: modifiability, portability, reusability, integrability, testability
Doc. Dr Ljubomir Lazi Kljent Server Sistemi (Softverske Arhitekture) @ 2007

19

Overview
What is it, why bother? Architecture Design Viewpoints and view models Architectural styles Architecture asssessment Role of the software architect

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

20

Attribute-Driven Design (Bass et al, Ch 7)


Choose module to decompose Refine this module:
choose architectural drivers (quality is driving force) choose pattern that satisfies drivers apply pattern

Repeat steps

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

21

Example ADD iterations


Top-level: usability separate user interface Seeheim/three tier architecture Lower-level, within user interface: security authenticate users Lower-level, within data layer: availability active redundancy

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

22

Generalized model
Understand problem Solve it Evaluate solution

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

23

Global workflow in architecture design


context synthesis architecture evaluation evaluation results

backlog requirements

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

24

Generalized model (contd)


assets architecture ideas synthesis

backlog
constraints

evaluation

eval results sign.reqs

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

25

Design issues, options and decisions


A designer is faced with a series of design issues
These are sub-problems of the overall design problem. Each issue normally has several alternative solutions (or design options) The designer makes a design decision to resolve each issue. This process involves choosing the best option from among the alternatives.

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

26

Taking decisions
subproblem (or issue)

Design problem
subproblem (or issue)

Problem space

Decision = best option

Design Design option option

Design option

Design option
Decision = best option

Decision space

Alternative solutions

Alternative solutions

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

27

Decision space
The space of possible designs that can be achieved by choosing different sets of alternatives.
fat-client client style client-server thin-client client in a separate user interface layer Programmed in Java

Programmed in Visual Basic Programmed in C++

monolithic

no separate user interface layer

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

28

Tree or graph?
Issues and options are not independent ...

fat-client client style client-server thin-client

client in a separate user interface layer

flexibility

layered

MVC

monolithic

no separate user interface layer

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

29

More than just IT


Technical and non-techical issues and options are intertwined
Architects deciding on the type of database

versus
Management deciding on new strategic partnership

or
Management deciding on budget

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

30

Some (tacit) decisions are related to norms and values

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

31

Types of decisions
Implicit, undocumented
Unaware, tacit, of course knowledge

Explicit, undocumented
Vaporizes over time

Explicit, explicitly undocumented


Tactical, personal reasons

Explicit, documented
Preferred, exceptional situation

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

32

Why is documenting design decisions important?


Prevents repeating (expensive) past steps Explains why this is a good architecture Emphasizes qualities and criticality for requirements/goals Provides context and background

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

33

Uses of design decisions


Identify key decisions for a stakeholder
Make the key decisions quickly available. E.g., introducing new people and make them up2date. ..., Get a rationale, Validate decisions against reqs

Evaluate impact
If we want to change an element, what are the elements impacted (decisions, design, issues)? ..., Cleanup the architecture, identify important architectural drivers

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

34

Elements of a design decision


Issues: design issues being addressed Decision Status: e.g., pending, approved Assumptions: underlying assumptions Alternatives Rationale; the why of the decision taken Implications: e.g. need for further decisions

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

35

Pointers on design decisions


Hofmeister et al, Generalizing a Model of Software Architecture Design from Five Industrial Approaches, Journal of Systems and Software, 2007 Tyree and Ackerman, Architecture decisions: demystifying architecture, IEEE Software, vol. 22(2), 2005. Kruchten, Lago and van Vliet, Building up and exploiting architectural knowledge, WICSA, 2005. Lago and van Vliet, Explicit assumptions enrich architectural models, ICSE, 2005.

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

36

Overview
What is it, why bother? Architecture Design Viewpoints and view models Architectural styles Architecture asssessment Role of the software architect

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

37

Software design in UML


Class diagrams, state diagrams, sequence diagram, etc Who can read those diagrams? Which type of questions do they answer? Do they provide enough information?

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

38

Who can read those diagrams?


Designer, programmer, tester, maintainer, etc. Client? User?

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

39

Which type of questions do they answer?


How much will it cost? How secure will the system be? Will it perform? How about maintenance cost? What if requirement A is replaced by requirement B?

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

40

Analogy with building architecture


Overall picture of building (client) Front view (client, beauty committee) Separate picture for water supply (plumber) Separate picture for electrical wiring (electrician) etc

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

41

Where We Started: Object-Oriented Programming


Object-oriented (OO) programming simplified software development through higher level abstractions & patterns, e.g., Associating related data & operations Decoupling interfaces & implementations
class X operation1() operation2() operation3() operationn() data

Well-written OO programs exhibit recurring structures that promote abstraction, flexibility, modularity, & elegance

Next Step: Distributed Object Computing (DOC)


Applies the Broker pattern to abstract away lower-level OS & protocol-specific details for network programming Creates distributed systems that are easier to model & build using OO techniques Result: robust distributed systems built with distributed object computing (DOC) middleware e.g., CORBA, Java RMI, etc. We now have more robust software & more powerful distributed systems
AbstractService service Client Proxy service Service service

: Client

operation()

Object : Interface X

Middleware

Component-based software engineering

Objectives
To explain that CBSE is concerned with developing standardised components and composing these into applications To describe components and component models To show the principal activities in the CBSE process To discuss approaches to component composition and problems that may arise

Topics covered
Components and component models The CBSE process Component composition

Component-based development
Component-based software engineering (CBSE) is an approach to software development that relies on software reuse. It emerged from the failure of object-oriented development to support effective reuse. Single object classes are too detailed and specific. Components are more abstract than object classes and can be considered to be stand-alone service providers.

CBSE essentials
Independent components specified by their interfaces. Component standards to facilitate component integration. Middleware that provides support for component inter-operability. A development process that is geared to reuse.

CBSE and design principles


Apart from the benefits of reuse, CBSE is based on sound software engineering design principles:
Components are independent so do not interfere with each other; Component implementations are hidden; Communication is through well-defined interfaces; Component platforms are shared and reduce development costs.

CBSE problems
Component trustworthiness - how can a component with no available source code be trusted? Component certification - who will certify the quality of components? Emergent property prediction - how can the emergent properties of component compositions be predicted? Requirements trade-offs - how do we do trade-off analysis between the features of one component and another?

Components
Components provide a service without regard to where the component is executing or its programming language
A component is an independent executable entity that can be made up of one or more executable objects; The component interface is published and all interactions are through the published interface;

Component definitions
Councill and Heinmann:
A software component is a software element that conforms to a component model and can be independently deployed and composed without modification according to a composition standard.

Szyperski:
A software component is a unit of composition with contractually specified interfaces and explicit context dependencies only. A software component can be deployed independently and is subject to composition by third-parties.

Component as a service provider


The component is an independent, executable entity. It does not have to be compiled before it is used with other components. The services offered by a component are made available through an interface and all component interactions take place through that interface.

Component characteristics 1
Standardised Component standardisation means that a component that is used in a CBSE process has to conform to some standardised component model. This model may define component interfaces, component meta-data, documentation, composition and deployment. A component should be independent it should be possible to compose and deploy it without having to use other specific components. In situations where the component needs externally provided services, these should be explicitly set out in a requires interface specification. For a component to be composable, all external interactions must take place through publicly defined interfaces. In addition, it must provide external access to information about itself such as its methods and attributes.

Independent

Composable

Component characteristics 2

Deployable

To be deployable, a component has to be self-contained and must be able to operate as a stand-alone entity on some component platform that implements the component model. This usually means that the component is a binary component that does not have to be compiled before it is deployed. Components have to be fully documented so that potential users of the component can decide whether or not they meet their needs. The syntax and, ideally, the semantics of all component interfaces have to be specified.

Documented

Component interfaces
Provides interface
Defines the services that are provided by the component to other components.

Requires interface
Defines the services that must be made available for the component to execute as specified.

Component interfaces

Requires int erface Defines the services from the com ponents environm ent that it uses Com ponent

Provides int erface Defines the services that are provided by the com ponent to other com ponents

Provides/requires interfaces
These interfaces are NOT the same as input/output interfaces. Both of these interfaces define both the inputs needed and the outputs produced by the provided and required services Requires
You can think of this as defining the methods that are called by a component or before a component executes

Provides
You can think of this as defining how the component is called.

A data collector component


Requires int erface Provides int erface addSensor rem oveSensor star tSensor stopSensor testSensor initialise report listAll

sensorManagem ent Data collector sensorData

Components and objects


Components are deployable entities. Components do not define types. Component implementations are opaque. Components are language-independent. Components are standardised.

Component models
A component model is a definition of standards for component implementation, documentation and deployment. Examples of component models
EJB model (Enterprise Java Beans) COM+ model (.NET model) Corba Component Model

The component model specifies how interfaces should be defined and the elements that should be included in an interface definition.

Elements of a component model


Custom isation Naming convention Com position Interace f definition Specific interaces f Meta-data access U sage inform ation Com ponent m odel Docum entation Packag ing Evolution support

Interaces f

Deploym ent and use

Middleware support
Component models are the basis for middleware that provides support for executing components. Component model implementations provide:
Platform services that allow components written according to the model to communicate; Horizontal services that are application-independent services used by different components.

To use services provided by a model, components are deployed in a container. This is a set of interfaces used to access the service implementations.

Component model services


Horizontal services Component m anagement Concurrency Transaction m anagement Persistence Resource management Security

Platform services Addressing Interface definition Exception Com ponent management com munications

Component development for reuse


Components are rarely created by simply using part of the code of another application system Rather, components for reuse have to be specifically developed so that they are reusable across a range of applications

Component development for reuse


Components developed for a specific application usually have to be generalised to make them reusable. A component is most likely to be reusable if it associated with a stable domain abstraction (business object). For example, in a hospital stable domain abstractions are associated with the fundamental purpose nurses, patients, treatments, etc.

Component development for reuse


Components for reuse may be specially constructed by generalising existing components. Component reusability Should reflect stable domain abstractions; Should hide state representation; Should be as independent as possible; Should publish exceptions through the component interface. There is a trade-off between reusability and usability The more general the interface, the greater the reusability but it is then more complex and hence less usable.

Changes for reusability


Remove application-specific methods. Change names to make them general. Add methods to broaden coverage. Make exception handling consistent. Add a configuration interface for component adaptation. Integrate required components to reduce dependencies.

Legacy system components


Existing legacy systems that fulfil a useful business function can be re-packaged as components for reuse. This involves writing a wrapper component that implements provides and requires interfaces then accesses the legacy system. Although costly, this can be much less expensive than rewriting the legacy system. We will return to issues of legacy system reuse in the discussion of service-oriented systems.

Reusable components
The development cost of reusable components may be higher than the cost of specific equivalents. This extra reusability enhancement cost should be an organization rather than a project cost. Generic components may be less space-efficient and may have longer execution times than their specific equivalents.

CBSE Processes
As discussed, conventional software engineering processes have to be adapted for reuse.

The CBSE process


When reusing components, it is essential to make trade-offs between ideal requirements and the services actually provided by available components. This involves:
Developing outline requirements; Searching for components then modifying requirements according to available functionality. Searching again to find if there are better components that meet the revised requirements.

The CBSE process


Modify requir m ents e accor ding to discovered com ponents

Outline system requir m ents e

Identify candidate com ponents

Architectur al design

Identify candidate com ponents

Com pose com ponents to create system

The component identification process

Component search

Component selection

Component validation

Component identification issues


Trust. You need to be able to trust the supplier of a component. At best, an untrusted component may not operate as advertised; at worst, it can breach your security. Requirements. Different groups of components will satisfy different requirements. Validation.
The component specification may not be detailed enough to allow comprehensive tests to be developed. Components may have unwanted functionality. How can you test this will not interfere with your application?

Component composition
Designing a system by integrating a number of components.

Component composition
The process of assembling components to create a system. Composition involves integrating components with each other and with the component infrastructure. Normally you have to write glue code to integrate components.

Types of composition
Sequential composition where the composed components are executed in sequence. This involves composing the provides interfaces of each component. Hierarchical composition where one component calls on the services of another. The provides interface of one component is composed with the requires interface of another. Additive composition where the interfaces of two components are put together to create a new component.

Types of composition

(a)

(b)

(c)

Sequential composition
In this case, the components are executed in sequence to provide some required effect The outputs from the provides interface from the first component executed become the inputs for the provides interface for the 2nd unit called (perhaps with some modification through an adapter component) Each component is executed independently and does not have to be aware of the other components in the sequence.

Hierarchical composition
In this case, one component (defined in the requires interface) is called directly from within the body of the other component. The calling component must know the name and the interface signature of the called component.

Additive composition
In this case, we put two components together so that the provides interface includes operations that come from both of the composed components. Essentially, this is normally implemented by defining a new small component that offers the combined interface and which than calls one of the composed components, depending on the call to the composed component.

Interface incompatibility
Parameter incompatibility where operations have the same name but are of different types. Operation incompatibility where the names of operations in the composed interfaces are different. Operation incompleteness where the provides interface of one component is a subset of the requires interface of another.

Incompatible components
string location(string pn) string owner (string pn) string proper ype (string pn) tyT

phoneDatabase (string com m and) addressFinder

m apDB (string com m and) m apper

displayMap (string postCode, scale) printMap (string postCode, scale)

Incompatibility
The component addressFinder through its location method produces a string which is the address of the property, including street number and name and town The component mapper through its displayMap method, expects a string which is a postcode only (not a complete address)

Adaptor components
Address the problem of component incompatibility by reconciling the interfaces of the components that are composed. Different types of adaptor are required depending on the type of composition. An addressFinder and a mapper component may be composed through an adaptor (called postCodeStripper) that strips the postal code from an address and passes this to the mapper component.

Composition through an adaptor


The component postCodeStripper is the adaptor that facilitates the sequential composition of addressFinder and mapper components.

Adaptor for data collector

star t sensor stop getdata

sensorManagem ent

addSensor rem oveSensor star tSensor Data collector stopSensor testSensor initialise report listAll

Adapter sensorData

Adaptor functionality
The data collector component requires a sensorManagement component that provides facilities to stop and start sensors and to query sensors for data The adapter component in this case turns a string of sensor management commands e.g. sensor.stop into the commands required for a specific sensor device.

Interface semantics
You have to rely on component documentation to decide if interfaces that are syntactically compatible are actually compatible. Consider an interface for a PhotoLibrary component:

public void addItem (Identifier pid ; Photograph p; CatalogEntry photodesc) ; public Photograph retrieve (Identifier pid) ; public CatalogEntry catEntry (Identifier pid) ;

Photo library composition

addItem Photo Library retrieve catEntry adaptor

getImage

Image Manager

getCatalogEntry U ser Interface

Photo Library documentation


This method adds a photograph to the library and associates the photograph identifier and catalogue descriptor with the photograph. what happens if the photograph identifier is already associated with a photograph in the library? is the photograph descriptor associated with the catalogue entry as well as the photograph i.e. if I delete the photograph, do I also delete the catalogue information?

The Object Constraint Language


The Object Constraint Language (OCL) has been designed to define constraints that are associated with UML models. It is based around the notion of pre and post condition specification - similar to the approach used in Z as described in Chapter 10.

Formal description of photo library

Photo library conditions


As specified, the OCL associated with the Photo Library component states that:
There must not be a photograph in the library with the same identifier as the photograph to be entered; The library must exist - assume that creating a library adds a single item to it; Each new entry increases the size of the library by 1; If you retrieve using the same identifier then you get back the photo that you added; If you look up the catalogue using that identifier, then you get back the catalogue entry that you made.

Composition trade-offs
When composing components, you may find conflicts between functional and non-functional requirements, and conflicts between the need for rapid delivery and system evolution. You need to make decisions such as:
What composition of components is effective for delivering the functional requirements? What composition of components allows for future change? What will be the emergent properties of the composed system?

Data collection and report generation


(a) Report generator

Data collection

Data m anagement

Report

(b)

Data collection

Data base

Report

Composition trade-offs
For composition (a), reporting and data management are separate so there is more flexibility if changes in one of these functions but not the other have to be made. For composition (b), there are fewer discrete components so faster communications within the component offering both data management and report generation.

Key points
CBSE is a reuse-based approach to defining and implementing loosely coupled components into systems. A component is a software unit whose functionality and dependencies are completely defined by its interfaces. A component model defines a set of standards that component providers and composers should follow. During the CBSE process, the processes of requirements engineering and system design are interleaved.

Key points
Component composition is the process of wiring components together to create a system. When composing reusable components, you normally have to write adaptors to reconcile different component interfaces. When choosing compositions, you have to consider required functionality, non-functional requirements and system evolution.

Creates a standard virtual boundary around application component implementations that interact only via welldefined interfaces

Solution: Component Middleware


Define standard container mechanisms needed to execute components in generic component servers

Specify the infrastructure needed to configure & deploy components throughout a distributed system

Container

<ComponentAssemblyDescription id="a_HUDDisplay"> ... <connection> <name>GPS-RateGen</name> <internalEndPoint><portName>Refresh</portName><instance>a_GPS</instance></internalEndPoint> <internalEndPoint><portName>Pulse</portName><instance>a_RateGen</instance></internalEndPoint> </connection> <connection> <name>NavDisplay-GPS</name> <internalEndPoint><portName>Refresh</portName><instance>a_NavDisplay</instance></internalEndPoint> <internalEndPoint><portName>Ready</portName><instance>a_GPS</instance></internalEndPoint> </connection> ... </ComponentAssemblyDescription>

Birdseye View of Component Middleware


Components encapsulate application business logic Components interact via ports Provided interfaces, e.g.,facets Required connection points, e.g., receptacles Event sinks & sources Attributes Containers provide execution environment for components with common operating requirements Components/containers can also Communicate via a middleware bus & Reuse common middleware services

Container Container

Middleware Bus
Replication A/V Streaming Security Persistence Notification

Scheduling

Load Balancing

Component middleware defines interfaces, policies, & some implementations

Component-based Software: Component


Component Modular Encapsulates its contents Replaceable black box, conformance defined by interface compatibility Component Interface Ports consist of provided interfaces (facets) & required (used) interfaces (receptacles) Attributes Component Implementation Monolithic (i.e., executable software) or Assembly-based (a set of interconnected subcomponents)

CCM Features Retained in LwCCM Subset


All types of ports, i.e., Facets Receptacles Event sources & sinks Attributes
Facets Component Reference Event Receptacles Sources Component Home

Generic port management operations in CCMObject Monolithic implementations Session/service component/ container types

Attributes

Container

Required Sends Ports To

Component homes

Receives Offered From Ports

Event Sinks

Component Integrated ACE ORB Lightweight CCM implementation atop TAO Supports component-oriented paradigm for DRE applications Provides Real-time CORBA policies & mechanisms required for DRE applications

Overview of CIAO

Key DRE aspects are supported as first-class metadata First official release (CIAO 0.4) was at end of December 2003 Latest release is downloadable from deuce.doc.wustl.edu/Download.html

Architecture presentations in practice


By and large two flavors:
Powerpoint slides for managers, users, consultants, etc UML diagrams, for technicians

A small sample

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

106

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

107

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

108

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

109

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

110

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

111

So,
Different representations For different people For different purposes These representations are both descriptive and prescriptive

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

112

IEEE model for architectural descriptions


Mission

Environment

System

Architecture

Stakeholder

Architecture Description

Rationale

Concern

Viewpoint

View

Library Viewpoint

Model

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

113

Some terms (from IEEE standard)


System stakeholder: an individual, team, or organization (or classes hereof) with interests in, or concerns relative to, a system. View: a representation of a whole system from the perspective of a related set of concerns. Viewpoint: A viewpoint establishes the purposes and audience for a view and the techniques or methods employed in constructing a view.

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

114

Stakeholders
Architect Requirements engineer Designer (also of other systems) Implementor Tester, integrator Maintainer Manager Quality assurance people

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

115

Viewpoint specification
Viewpoint name Stakeholders addressed Concerns addressed Language, modeling techniques

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

116

Kruchtens 4+1 view model


End-user Functionality Programmers Software management

Logical Viewpoint

Implementation Viewpoint Scenarios

Process Viewpoint
Integrators Performance Scalability

Deployment Viewpoint
System engineers Topology Communications

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

117

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

118

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

119

Checklist for Architecture Reviews

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

120

Checklist for Architecture Reviews

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

121

Checklist for Architecture Reviews

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

122

4 + 1: Logical Viewpoint
The logical viewpoint supports the functional requirements, i.e., the services the system should provide to its end users. Typically, it shows the key abstractions (e.g., classes and interactions amongst them).

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

123

4 + 1: Process Viewpoint

Addresses concurrent aspects at runtime (tasks, threads, processes and their interactions) It takes into account some nonfunctional requirements, such as performance, system availability, concurrency and distribution, system integrity, and fault-tolerance.

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

124

4 + 1: Deployment Viewpoint
The deployment viewpoint defines how the various elements identified in the logical, process, and implementation viewpoints-networks, processes, tasks, and objects-must be mapped onto the various nodes. It takes into account the system's nonfunctional requirements such as system availability, reliability (fault-tolerance), performance (throughput), and scalability.

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

125

4 + 1: Implementation Viewpoint
The imlementation viewpoint focuses on the organization of the actual software modules in the software-development environment. The software is packaged in small chunks-program libraries or subsystems-that can be developed by one or more developers.

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

126

4 + 1: Scenario Viewpoint
The scenario viewpoint consists of a small subset of important scenarios (e.g., use cases) to show that the elements of the four viewpoints work together seamlessly. This viewpoint is redundant with the other ones (hence the "+1"), but it plays two critical roles:
it acts as a driver to help designers discover architectural elements during the architecture design; it validates and illustrates the architecture design, both on paper and as the starting point for the tests of an architectural prototype.
Doc. Dr Ljubomir Lazi Kljent Server Sistemi (Softverske Arhitekture) @ 2007

127

Architectural views from Bass et al (view = representation of a structure)


Module views
Module is unit of implementation Decomposition, uses, layered, class

Component and connector (C & C) views


These are runtime elements Process (communication), concurrency, shared data (repository), client-server

Allocation views
Relationship between software elements and environment Work assignment, deployment, implementation

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

128

Module views
Decomposition: units are related by is a submodule of, larger modules are composed of smaller ones Uses: relation is uses (calls, passes information to, etc). Important for modifiability Layered is special case of uses, layer n can only use modules from layers <n Class: generalization, relation inherits from

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

129

Component and connector views


Process: units are processes, connected by communication or synchronization Concurrency: to determine opportunities for parallelism (connector = logical thread) Shared data: shows how data is produced and consumed Client-server: cooperating clients and servers

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

130

Allocation views
Deployment: how software is assigned to hardware elements Implementation: how software is mapped onto file structures Work assignment: who is doing what

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

131

How to decide on which viewpoints


What are the stakeholders and their concerns? Which viewpoints address these concerns? Prioritize and possibly combine viewpoints

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

132

Decision visualization

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

133

Business viewpoint

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

134

A caveat on quality
A view can be used to assess one or more quality attributes E.g., some type of module view can be used to assess modifiability It should then expose the design decisions that affect this quality attribute

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

135

Overview
What is it, why bother? Architecture Design Viewpoints and view models Architectural styles Architecture asssessment Role of the software architect

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

136

Architectural styles
An architectural style is a description of component and connector types and a pattern of their runtime control and/or data transfer. Examples:
main program with subroutines data abstraction implicit invocation pipes and filters repository (blackboard) layers of abstraction
Kljent Server Sistemi (Softverske Arhitekture) @ 2007

Doc. Dr Ljubomir Lazi

137

Alexanders patterns
There is abundance evidence to show that high buildings make people crazy. High buildings have no genuine advantage, except in speculative gains. They are not cheaper, they do not help to create open space, they make life difficult for children, they wreck the open spaces near them. But quite apart from this, empirical evidence shows that they can actually damage peoples minds and feelings. In any urban area, keep the majority of buildings four stories high or less. It is possible that certain buildings should exceed this limit, but they should never be buildings for human habitation.
Doc. Dr Ljubomir Lazi Kljent Server Sistemi (Softverske Arhitekture) @ 2007

138

General flavor of a pattern


IF you find yourself in <context>, for example <examples>, with <problem> THEN for some <reasons>, apply <pattern> to construct a solution leading to a <new context> and <other patterns>

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

139

Components and Connectors

Components are connected by connectors. They are the building blocks with which an architecture can be described. No standard notation has emerged yet.
Doc. Dr Ljubomir Lazi Kljent Server Sistemi (Softverske Arhitekture) @ 2007

140

Types of components
computational: does a computation of some sort. E.g. function, filter. memory: maintains a collection of persistent data. E.g. data base, file system, symbol table. manager: contains state + operations. State is retained between invocations of operations. E.g. adt, server. controller: governs time sequence of events. E.g. control module, scheduler.
Doc. Dr Ljubomir Lazi Kljent Server Sistemi (Softverske Arhitekture) @ 2007

141

Types of connectors
procedure call (including RPC) data flow (e.g. pipes) implicit invocation message passing shared data (e.g. blackboard or shared data base) instantiation

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

142

Framework for describing architectural styles


problem: type of problem that the style addresses. Characteristics of the reqss guide the designer in his choice for a particular style. context: characteristics of the environment that constrain the designer, reqs imposed by the style. solution: in terms of components and connectors (choice not independent), and control structure (order of execution of components) variants examples
Doc. Dr Ljubomir Lazi Kljent Server Sistemi (Softverske Arhitekture) @ 2007

143

Main-program-with-subroutines style
problem: hierarchy of functions; result of functional decomposition, single thread of control context: language with nested procedures solution:
system model: modules in a hierarchy, may be weak or strong, coupling/cohesion arguments components: modules with local data, as well as global data connectors: procedure call control structure: single thread, centralized control: main program pulls the strings

variants: OO versus non-OO

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

144

Abstract-data-type style
problem: identify and protect related bodies of information. Data representations likely to change. context: OO-methods which guide the design, OO-languages which provide the class-concept solution:
system model: component has its own local data (= secret it hides) components: managers (servers, objects, adts) connectors: procedure call (message) control structure: single thread, usually; control is decentralized

variants: caused by language facilities

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

145

Implicit-invocation style
problem: loosely coupled collection of components. Useful for applications which must be reconfigurable. context: requires event handler, through OS or language. solution:
system model: independent, reactive processes, invoked when an event is raised components: processes that signal events and react to events connectors: automatic invocation control structure: decentralized control. Components do not know who is going to react.

variants: Tool-integration frameworks, and languages with special features.


Doc. Dr Ljubomir Lazi Kljent Server Sistemi (Softverske Arhitekture) @ 2007

146

Pipes-and-filters style
problem: independent, sequential transformations on ordered data. Usually incremental, Ascii pipes. context: series of incremental transformations. OS-functions transfer data between processes. Error-handling difficult. solution:
system model: continuous data flow; components incrementally transform data components: filters for local processing connectors: data streams (usually plain ASCII) control structure: data flow between components; component has own flow

variants: From pure filters with little internal state to batch processes

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

147

Repository style
Client
Shared Data

Client

Client

problem: manage richly structured information, to be manipulated in many different ways. Data is long-lived. context: shared data to be acted upon by multiple clients solution:
system model: centralized body of information. Independent computational elements. components: one memory, many computational connectors: direct access or procedure call control structure: varies, may depend on input or state of computation

variants: traditional data base systems, compilers, blackboard

148

Layered style
Layern Layer2 Layer1

problem: distinct, hierarchical classes of services. Concentric circles of functionality context: a large system that requires decomposition (e.g., virtual machines, OSI model) solution:
system model: hierarchy of layers, often limited visibility components: collections of procedures (module) connectors: (limited) procedure calls control structure: single or multiple threads
Kljent Server Sistemi (Softverske Arhitekture) @ 2007

variants: relaxed layering


Doc. Dr Ljubomir Lazi

149

Model-View-Controller (MVC) style


Controller n Model View n

problem: separation of UI from application is desirable due to expected UI adaptations context: interactive applications with a flexible UI solution:
system model: UI (View and Controller Component(s)) is decoupled from the application (Model component) components: collections of procedures (module) connectors: procedure calls control structure: single thread

variants: Document-View
Doc. Dr Ljubomir Lazi Kljent Server Sistemi (Softverske Arhitekture) @ 2007

150

Overview
What is it, why bother? Architecture Design Viewpoints and view models Architectural styles

Architecture asssessment Role of the software architect

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

151

Architecture evaluation/analysis
Assess whether architecture meets certain quality goals, such as those w.r.t. maintainability, modifiability, reliability, performance Mind: the architecture is assessed, while we hope the results will hold for a system yet to be built

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

152

Software Architecture Analysis


Software architecture
implementation

System

Properties

properties

Qualities

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

153

Analysis techniques
Questioning techniques: how does the system react to various situations; often make use of scenarios Measuring techniques: rely on quantitative measures; architecture metrics, simulation, etc

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

154

Scenarios in Architecture Analysis


Different types of scenarios, e.g. use-cases, likely changes, stress situations, risks, far-into-the-future scenarios Which stakeholders to ask for scenarios? When do you have enough scenarios?

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

155

Preconditions for successful assessment


Clear goals and requirements for the architecture Controlled scope Cost-effectiveness Key personnel availability Competent evaluation team Managed expectations

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

156

Architecture Tradeoff Analysis Method (ATAM)


Reveals how well architecture satisfies quality goals, how well quality attributes interact, i.e. how they trade off Elicits business goals for system and its architecture Uses those goals and stakeholder participation to focus attention to key portions of the architecture

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

157

Benefits
Financial gains Forced preparation Captured rationale Early detection of problems Validation of requirements Improved architecture

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

158

Participants in ATAM
Evaluation team Decision makers Architecture stakeholders

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

159

Phases in ATAM
0: partnership, preparation (informally) 1: evaluation (evaluation team + decision makers, one day) 2: evaluation (evaluation team + decision makers + stakeholders, two days) 3: follow up (evaluation team + client)

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

160

Steps in ATAM (phase 1 and 2)


Present method Present business drivers (by project manager of system) Present architecture (by lead architect) Identify architectural approaches/styles Generate quality attribute utility tree (+ priority, and how difficult) Analyze architectural approaches Brainstorm and prioritize scenarios Analyze architectural approaches Present results

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

161

Example Utility tree


Performance
Transaction response time (H, M) Throughput 150 transactions/sec

Training

Utility

Usability
Normal operations

Maintainability
Doc. Dr Ljubomir Lazi

Database vendor releases new version

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

162

Outputs of ATAM
Concise presentation of the architecture Articulation of business goals Quality requirements expressed as set of scenarios Mapping of architectural decisions to quality requirements Set of sensitivity points and tradeoff points Set of risks, nonrisks, risk themes

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

163

Important concepts in ATAM


Sensitivity point: decision/property critical for certain quality attribute Tradeoff point: decision/property that affects more than one quality attribute Risk: decision/property that is a potential problem These concepts are overlapping

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

164

Software Architecture Analysis Method (SAAM)


Develop scenarios for
kinds of activities the system must support kinds of changes anticipated

Describe architecture(s) Classify scenarios


direct -- use requires no change indirect -- use requires change

Evaluate indirect scenarios: changes and cost Reveal scenario interaction Overall evaluation

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

165

Scenario interaction in SAAM


Two (indirect) scenarios interact if they require changes to the same component Scenario interaction is important for two reasons:
Exposes allocation of functionality to the design Architecture might not be at right level of detail

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

166

Overview
What is it, why bother? Architecture Design Viewpoints and view models Architectural styles Architecture asssessment

Role of the software architect

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

167

Role of the software architect


Key technical consultant Make decisions Coach of development team Coordinate design Implement key parts Advocate software architecture

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

168

Summary
new and immature field proliferation of terms: architecture - design pattern framework - idiom architectural styles and design pattern describe (how are things done) as well as prescribe (how should things be done) stakeholder communication early evaluation of a design transferable abstraction

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

169

Further reading
Mary Shaw and David Garlan, Software Architecture; Perspectives of an Emerging Discipline, 1995. Philippe B. Kruchten, The 4+1 view model of architecture, IEEE Software, 12(6):42-50, November 1995. Frank Buschmann et al., Pattern-Oriented Software Architecture: A System of Patterns, 1996. Part II: 2001. Erich Gamma et al., Design Patterns: Elements of Reusable Object-Oriented Software, 1995. Len Bass et al, Sofware Architecture in Practice, 2003 (2nd edition). C. Hofmeister et al., Applied Software Architecture, 1999. Jan Bosch, Design & Use of Software Architectures, 2000.

Doc. Dr Ljubomir Lazi

Kljent Server Sistemi (Softverske Arhitekture) @ 2007

170

S-ar putea să vă placă și