CS 4311 Software Architecture Frank Tsui, Orland Karam, and Barbara Bernal, Essential of Software...

31
CS 4311 Software Architecture Frank Tsui, Orland Karam, and Barbara Bernal, Essential of Software Engineering, 3rd edition, Jones & Bartett Learning. Section 7.2. Hans Van Vliet, Software Engineering, Principles and Practice, 3 rd edition, John Wiley & Sons, 2008. Chapter 11. M. Shaw and D. Garlan, Software Architecture: Perspectives on an Emerging Discipline, Prentice Hall, 1996.

Transcript of CS 4311 Software Architecture Frank Tsui, Orland Karam, and Barbara Bernal, Essential of Software...

CS 4311

Software Architecture

Frank Tsui, Orland Karam, and Barbara Bernal, Essential of Software Engineering, 3rd edition, Jones & Bartett Learning. Section 7.2.Hans Van Vliet, Software Engineering, Principles and Practice, 3rd edition, John Wiley & Sons, 2008. Chapter 11.M. Shaw and D. Garlan, Software Architecture: Perspectives on an Emerging Discipline, Prentice Hall, 1996.

CS 4311

Learning Objectives

To understand the concept of software architectures along with its motivation

To be able to characterize some important software architecture styles

2

3CS 4311

Outline

What’s software architecture? Elements of software architecture Architectural styles

CS 4311

4

Architecture in Civil Engineering

Arch Beam Suspension Cable-stayed

Design at the highest level Example: Bridge architectures

CS 4311

5

Architecture in Civil Engineering

Arch Beam Suspension Cable-stayed

Design at the highest level Example: Bridge architectures

Why do civil engineers talk about bridge architectures?

CS 4311

6

What Is Architecture?

“Arch” used as prefix or suffix Meaning: Main, chief, principal, most important, highest,

fundamental, basic, extreme or most characteristic, ruler, leader

Examples:Archangel, archenemy, archduke, archbishopMatriarch, patriarch, monarch

Definition in Civil Engineering The art and science of designing and erecting buildings Fundamental underlying design of buildings Style and method of design and construction of buildings

Buildings and other structures CS 4311

7

What Is Software Architecture?

Framework, mechanism, way, shape, form, means, organization, arrangement

The Big Picture!

CS 4311

8

Software Architecture

The structure or structures of a software system software components externally visible properties of those components the relationships between them

The set of principle design decisions made about a software system System structure Functional behavior Interaction Nonfunctional properties Implementation System goals, stakeholders, non-technical considerations, etc.

CS 4311

99CS 4311

Outline

What’s software architecture? Elements of software architecture Architectural styles

CS 4311

10

Elements of Software Architecture

Components Connectors Configuration topologies System models

CS 4311

11

Software Components

Elements that encapsulate processing and data in a system’s architecture

An architectural entity that encapsulates a subset of the system’s functionality and/or data, restricts access to that subset via an explicitly defined interface,

and had explicitly defined dependencies on its required execution

context.

Often represented as boxes in diagrams.

CS 4311

12

Connectors

Elements that are tasked with effecting and regulating interactions among components.

Application independent. Often represented as lines in diagrams.

component

connector

CS 4311

13

Configuration Topology

• A set of specific associations between the components and connectors of a software system’s architecture.

CS 4311

14

System Models

An artifact that captures some or all of the design decisions that comprise a system’s architecture.

Architectural modeling is the reification and documentation of those design decisions.

Different models: structural vs. behavioral static vs. dynamic Scope

Q: Key constraints of layered model?

CS 4311

1515CS 4311

Outline

What’s software architecture? Elements of software architecture Architectural styles

CS 4311

16

Architectural Styles

A named collection of architectural design decisions that: are applicable in a given development context, constrain architectural design decisions that are

specific to a particular system with that context, and elicit beneficial qualities in each resulting system.

Not about: specific systems, components, interaction mechanisms, or configurations.

CS 4311

17

An Architectural Style Example

Physically separate the software components used to request services from the components that provide the services, to allow for proper distribution and scaling up, both in the number of service providers and service requesters.

Make the service providers unaware of the requesters’ identity to allow the providers to service transparently many, possibly changing requestors.

Insulate the requesters from one another to allow for their independent addition, removal, and modification. Make the requesters dependent only on the service providers.

Allow for multiple service providers to emerge dynamically to off-load the existing providers should the demand for services increase above a given threshold.

CS 4311

18

Example: Client-Server

CS 4311

19

More on Architectural Styles

Advantages Each style emphasizes one or more of the quality attributes,

such as usability, availability, security, performance, maintainability, flexibility, portability, etc.

Remarks: Each style has its own advantages and drawbacks. An application may require several architectural views. Choosing the right views is a key factor in having a good

design.

CS 4311

20

The Repertoire of Architecture Styles

Client-Server Architecture Style

Application context: Clients request services from a server Centralization of computation and data at the server Separation of user interface tasks from computation and

data management and storage

Q: Any examples?

CS 4311

21

Style: Client-Server

Components: Clients and server Connectors: Remote procedure call, network protocols Data elements: Parameters and return values are sent by the

connectors Topology: Two-level, with multi-clients Qualities yielded: Centralization of computation and data at the

server, with the information made available to remote clients. A single powerful server can service many clients.

Cautions: Network bandwidth.

CS 4311

22

Style: Three-Tier or N-Tier

Application context: Client-Server architecture style Multi-level services are needed

Q: Examples?

CS 4311

23

Style: Layered

Application context: Ordered layered services are necessary Insulate upper layer from lower layer

Q: Examples?

CS 4311

24

Layered (Cont.)

Components: Layers, offering a set of services to other layers, typically comprising several programs or subprograms

Connectors: Procedure call Data elements: Parameters and return values are sent by the

connectors Topology: Linear, for strict virtual machine; a directed acyclic graph

in looser interpretations Qualities yielded: Clear dependence structure; Software at upper

levels immune to changes of implementation within lower levels as long as the service specification are invariant; Software at lower levels fully independent of upper levels.

Cautions: Efficiency

CS 4311

25

Style: Repository

Application context: Collaborate and communicate through a shared

repository A.k.a. shared state, blackboard, whiteboard Q: Examples?

CS 4311

26

Repository (Cont.)

Components: ? Connectors: ? Data elements: ? Topology: ? Qualities yielded: ? Cautions: ?

CS 4311

27

Style: Batch Sequential

Application context: A series of dedicated and independent components

that transforms data in a sequential manner. Each component needs to finish its task before the

next one can start. Q: Examples?

CS 4311

28

Batch Sequential (Cont.)

Components: Independent programs responsible for a particular task or transformation

Connectors: Procedure call Data elements: Intermediate data produced or transformed Topology: Linear or ordered Qualities yielded: Solve complex task by dividing it into

several easier tasks; obtain modifiability/maintainability, reusability, and flexibility

Cautions: Error handling; efficiency

CS 4311

29

Style: Pipes and Filters

Application context: A series of independent, sequential transformations

on ordered data Consists of filters transforming data and pipes

transferring data Q: Examples?

% ps | grep bash | sort | more

CS 4311

30

More Architectural Styles

Client server Three-tier Layered Repository Batch sequential Pipe and filter

Event driven Interpreter Peer-to-peer Plug-in Service-oriented Publish-subscribe Rule-based Mobile code …

CS 4311

31

In-Class and Assignment:

Study two architectural styles per team Prepare a 10-minute presentation for the next class You will present:

What is it? What problem does it solve? How does it solve the problem? Who are the actors (i.e., main elements)? How do they relate to each other? What’re the strengths and drawbacks? Example applications? Include your sources (e.g., websites)

CS 4311