architectural styles...architectural style & software architecture •subsystem decomposition:...

25
1 © 2006 Bernd Bruegge Software Engineering WS 2006/2007 Architectural Styles Bernd Bruegge, Ph.D. Applied Software Engineering Technische Universitaet Muenchen Software Engineering I Lecture 08

Upload: others

Post on 28-May-2020

18 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Architectural Styles...Architectural Style & Software Architecture •Subsystem decomposition: Identification of subsystems, services, and their relationship to each other. •Architectural

1© 2006 Bernd Bruegge Software Engineering WS 2006/2007

Architectural Styles

Bernd Bruegge, Ph.D.Applied Software Engineering

Technische Universitaet Muenchen

Software Engineering ILecture 08

Page 2: Architectural Styles...Architectural Style & Software Architecture •Subsystem decomposition: Identification of subsystems, services, and their relationship to each other. •Architectural

2© 2006 Bernd Bruegge Software Engineering WS 2006/2007

Architectural Style & Software Architecture

• Subsystem decomposition: Identification ofsubsystems, services, and their relationship toeach other.

• Architectural Style: A pattern for subsystemdecomposition

• Software Architecture: Instance of anarchitectural style

Page 3: Architectural Styles...Architectural Style & Software Architecture •Subsystem decomposition: Identification of subsystems, services, and their relationship to each other. •Architectural

3© 2006 Bernd Bruegge Software Engineering WS 2006/2007

There are many architectural styles

• Client/Server• Peer-To-Peer• Repository• Model/View/Controller• Three-tier, Four-tier• Pipes and Filters

Page 4: Architectural Styles...Architectural Style & Software Architecture •Subsystem decomposition: Identification of subsystems, services, and their relationship to each other. •Architectural

4© 2006 Bernd Bruegge Software Engineering WS 2006/2007

Client/Server Architectural Style

• One or many servers provide services to instancesof subsystems, called clients

Client

Server

+service1()+service2()

+serviceN()

**

requester provider

• Each client calls on the server, which performs some service and returns the result

The clients know the interface of the serverThe server does not need to know the interfaceof the client

• The response in general is immediate• End users interact only with the client.

Page 5: Architectural Styles...Architectural Style & Software Architecture •Subsystem decomposition: Identification of subsystems, services, and their relationship to each other. •Architectural

5© 2006 Bernd Bruegge Software Engineering WS 2006/2007

Client/Server Architectures

• Often used in the design of database systems• Front-end: User application (client)• Back end: Database access and manipulation (server)

• Functions performed by client:• Input from the user (Customized user interface)• Front-end processing of input data

• Functions performed by the database server:• Centralized data management• Data integrity and database consistency• Database security

Page 6: Architectural Styles...Architectural Style & Software Architecture •Subsystem decomposition: Identification of subsystems, services, and their relationship to each other. •Architectural

Design Goals for Client/Server Architectures

• Location-Transparency

• Server runs on many operating systemsand many networking environments

• Server might itself be distributed, butprovides a single "logical" service tothe user

• Client optimized for interactive display-intensive tasks; Server optimized forCPU-intensive operations

• Server can handle large # of clients

• User interface of client supports avariety of end devices (PDA, Handy,laptop, wearable computer)

• ServicePortability

• HighPerformance

• Reliability

• Scalability

• Flexibility

• Server should be able to surviveclient and communication problems.

A measure of success with which the observed behavior of a system confirms to the

specification of its behavior (Chapter 11: Testing)

Page 7: Architectural Styles...Architectural Style & Software Architecture •Subsystem decomposition: Identification of subsystems, services, and their relationship to each other. •Architectural

7© 2006 Bernd Bruegge Software Engineering WS 2006/2007

Problems with Client/Server Architectures

• Client/Server systems do not provide peer-to-peer communication

• Peer-to-peer communication is often needed• Example:

• Database must process queries from application andshould be able to send notifications to the applicationwhen data have changed

application1:DBUser

database:DBMS

1. updateData

application2:DBUser 2. changeNotification

Page 8: Architectural Styles...Architectural Style & Software Architecture •Subsystem decomposition: Identification of subsystems, services, and their relationship to each other. •Architectural

8© 2006 Bernd Bruegge Software Engineering WS 2006/2007

Peer-to-Peer Architectural StyleGeneralization of Client/Server Architecture

Peer

service1()service2()

serviceN()…

requester

provider

*

*

Clients can be servers and servers can be clients=> “A peer can be a client as well as a server”.

Page 9: Architectural Styles...Architectural Style & Software Architecture •Subsystem decomposition: Identification of subsystems, services, and their relationship to each other. •Architectural

9© 2006 Bernd Bruegge Software Engineering WS 2006/2007

Leve

l of ab

stra

ctio

n

Application

Presentation

Session

Transport

Network

DataLink

Physical

Example: Peer-to-Peer Architectural Style

• ISO’s OSI ReferenceModel

• ISO = InternationalStandard Organization

• OSI = Open SystemInterconnection

• Reference model whichdefines 7 layers andcommunicationprotocols between thelayers

Page 10: Architectural Styles...Architectural Style & Software Architecture •Subsystem decomposition: Identification of subsystems, services, and their relationship to each other. •Architectural

10© 2006 Bernd Bruegge Software Engineering WS 2006/2007

OSI Model Layers and their Services

• The Application layer is thesystem you are building (unlessyou build a protocol stack)

• The application layer is usuallylayered itself

• The Presentation layer performsdata transformation services,such as byte swapping andencryption

• The Session layer is responsiblefor initializing a connection,including authentication

Application

Presentation

Session

Transport

Network

DataLink

Physical

!

Page 11: Architectural Styles...Architectural Style & Software Architecture •Subsystem decomposition: Identification of subsystems, services, and their relationship to each other. •Architectural

OSI Model Layers and their Services

• The Transport layer is responsiblefor reliably transmitting messages

• Used by Unix programmers whotransmit messages over TCP/IP sockets

• The Network layer ensurestransmission and routing

• Services: Transmit and route datawithin the network

• The Datalink layer models frames• Services: Transmit frames without

error

• The Physical layer represents thehardware interface to the network

• Services: sendBit() and receiveBit()

Application

Presentation

Session

Transport

Network

DataLink

Physical

Page 12: Architectural Styles...Architectural Style & Software Architecture •Subsystem decomposition: Identification of subsystems, services, and their relationship to each other. •Architectural

12© 2006 Bernd Bruegge Software Engineering WS 2006/2007

The Application Layer Provides theAbstractions of the “New System”

ApplicationApplication

Presentation

Session

Transport

Network

Data Link

Physical

Bidirectional associa-tions for each layer

Presentation

Session

Transport

Network

Data Link

Physical

Processor 1 Processor 2

RMI

Page 13: Architectural Styles...Architectural Style & Software Architecture •Subsystem decomposition: Identification of subsystems, services, and their relationship to each other. •Architectural

13© 2006 Bernd Bruegge Software Engineering WS 2006/2007

Application

Presentation

Session

Transport

Network

DataLink

Physical

Frame

Packet

Bit

Connection

Format

Message

An Object-Oriented View of the OSI Model

• The OSI Model is aclosed softwarearchitecture (i.e., ituses opaque layering)

• Each layer can bemodeled as a UMLpackage containing aset of classesavailable for the layerabove

Page 14: Architectural Styles...Architectural Style & Software Architecture •Subsystem decomposition: Identification of subsystems, services, and their relationship to each other. •Architectural

14© 2006 Bernd Bruegge Software Engineering WS 2006/2007

Application Layer

Presentation Layer

Session Layer

Transport Layer

Network Layer

Data Link Layer

Physical

Bidirectional associa-tions for each layer

Presentation Layer

Session Layer

Transport Layer

Network Layer

Data Link Layer

Physical

Application Layer

Layer 1

Layer 2

Layer 3

Layer 4

Processor 1 Processor 2

Layer 1Layer 2Layer 3

Page 15: Architectural Styles...Architectural Style & Software Architecture •Subsystem decomposition: Identification of subsystems, services, and their relationship to each other. •Architectural

15© 2006 Bernd Bruegge Software Engineering WS 2006/2007

Middleware Allows Focus On Higher Layers

Application

Presentation

Session

Transport

Network

DataLink

Physical

Socket

Object

Wire

TCP/IP

CORBA

Ethernet

Page 16: Architectural Styles...Architectural Style & Software Architecture •Subsystem decomposition: Identification of subsystems, services, and their relationship to each other. •Architectural

16© 2006 Bernd Bruegge Software Engineering WS 2006/2007

Repository Architectural Style

• Subsystems access and modify data from a singledata structure called the repository

• Also called blackboard architecture

• Subsystems are loosely coupled (interact only through the repository)• Control flow is dictated by the repository through triggers or by the subsystems through locks and synchronization primitives

Subsystem

Repository

createData()setData()getData()searchData()

*

Page 17: Architectural Styles...Architectural Style & Software Architecture •Subsystem decomposition: Identification of subsystems, services, and their relationship to each other. •Architectural

17© 2006 Bernd Bruegge Software Engineering WS 2006/2007

Repository Architecture Example:Incremental Development Environment (IDE)

LexicalAnalyzer

SyntacticAnalyzerSemanticAnalyzer

CodeGenerator

Compiler

Optimizer

ParseTree SymbolTable

Repository

SyntacticEditor SymbolicDebugger

ParseTree

SymbolTable

Page 18: Architectural Styles...Architectural Style & Software Architecture •Subsystem decomposition: Identification of subsystems, services, and their relationship to each other. •Architectural

18© 2006 Bernd Bruegge Software Engineering WS 2006/2007

Model /View/ Controller Architectural Style• Subsystems are classified into 3 different types

Model subsystem: Responsible for application domainknowledge

subscribernotifier

*

1

initiatorrepository1*

View subsystem: Responsible for displaying applicationdomain objects to the user

Controller subsystem: Responsible for sequence ofinteractions with the user and notifying views of changes inthe model

Model

Controller

View

Page 19: Architectural Styles...Architectural Style & Software Architecture •Subsystem decomposition: Identification of subsystems, services, and their relationship to each other. •Architectural

19© 2006 Bernd Bruegge Software Engineering WS 2006/2007

3 Views of the name of this presentation3 Possibilities to change the name

Whathappens?

Page 20: Architectural Styles...Architectural Style & Software Architecture •Subsystem decomposition: Identification of subsystems, services, and their relationship to each other. •Architectural

20© 2006 Bernd Bruegge Software Engineering WS 2006/2007

Sequence of Events (UML CollaborationDiagram)

:Controller

:Model1. Views subscribe to event

:PowerpointView

2.User types new filename

5. Updated views

:InfoView

3. Request name change in model

:FolderView

4. Notification of subscribers

Page 21: Architectural Styles...Architectural Style & Software Architecture •Subsystem decomposition: Identification of subsystems, services, and their relationship to each other. •Architectural

21© 2006 Bernd Bruegge Software Engineering WS 2006/2007

InfoViewupdate()

Observerupdate()

*ObservableaddObserver()deleteObserver()notifyObservers()

getState()setState()

Subject-filename

ListViewupdate()

PowerpointViewupdate()Model View

(„Observer Pattern“)Class Diagram

Page 22: Architectural Styles...Architectural Style & Software Architecture •Subsystem decomposition: Identification of subsystems, services, and their relationship to each other. •Architectural

22© 2006 Bernd Bruegge Software Engineering WS 2006/2007

Additional Readings

• L.D. Erman, F. Hayes-Roth,• “The Hearsay-II-Speech- Understanding System:

Integrating knowledge to resolve uncertainty”, ACMComputing Surveys, Vol 12. No. 2, pp 213-253, 1980

• J.D. Day and H. Zimmermann,• “The OSI Reference Model”, Proc. Of the IEEE, Vol. 71,

pp 1334-1340, Dec 19983

Page 23: Architectural Styles...Architectural Style & Software Architecture •Subsystem decomposition: Identification of subsystems, services, and their relationship to each other. •Architectural

23© 2006 Bernd Bruegge Software Engineering WS 2006/2007

Summary

• System Design• An activity that reduces the gap between the problem

and an existing (virtual) machine• Decomposes the overall system into manageable parts

by using the principles of cohesion and coherence

• Architectural Style• A pattern of a typical subsystem decomposition

• Software architecture• An instance of an architectural style• Client Server• Peer-to-Peer• Model-View-Controller

Page 24: Architectural Styles...Architectural Style & Software Architecture •Subsystem decomposition: Identification of subsystems, services, and their relationship to each other. •Architectural

24© 2006 Bernd Bruegge Software Engineering WS 2006/2007

Architectural Styles

Prepared by

Bernd Bruegge, Ph.D.University Professor of Applied Software Engineering

Technische Universitaet Muenchen

Software Engineering IWeek 4, Lecture 3

Page 25: Architectural Styles...Architectural Style & Software Architecture •Subsystem decomposition: Identification of subsystems, services, and their relationship to each other. •Architectural

25© 2006 Bernd Bruegge Software Engineering WS 2006/2007

Backup and Example Slides