Docsity

Software Architecture and Design: A University Presentation by Steve Easterbrook, Study Guides, Projects, Research of Software Engineering

Toggle sidebar
bg1
1
University of Toronto Department of Computer Science
© 2012 Steve Easterbrook. This presentation is availabl e free for non-commercial use with attribution under a creative commons license. 1
Lecture 4:
Showing the architecture
Coupling and Cohesion
UML Package Diagrams
Software Architectural Styles:
Layered Architectures
Pipe-and-filter
Object Oriented Architecture
Implicit Invocation
Repositories
University of Toronto Department of Computer Science
© 2012 Steve Easterbrook. This presentation is availabl e free for non-commercial use with attribution under a creative commons license. 2
Coupling and Cohesion
Architectural Building blocks:
A good architecture:
Minimizes coupling between modules:
Goal: modules donʼt need to know much about one another to interact
Low coupling makes future change easier
Maximizes the cohesion of each module
Goal: the contents of each module are strongly inter-related
High cohesion means the subcomponents really do belong together
module module
connector
X
pf3
pf4
pf5
pf8
pf9
pfa

Partial preview of the text

Download Software Architecture and Design: A University Presentation by Steve Easterbrook and more Study Guides, Projects, Research Software Engineering in PDF only on Docsity!

© 2012 Steve Easterbrook. This presentation is available free for non-commercial use with attribution under a creative commons license. 1

Lecture 4:

Showing the architecture

 Coupling and Cohesion

 UML Package Diagrams

 Software Architectural Styles:

 Layered Architectures  Pipe-and-filter  Object Oriented Architecture  Implicit Invocation  Repositories

University of Toronto Department of Computer Science

© 2012 Steve Easterbrook. This presentation is available free for non-commercial use with attribution under a creative commons license. 2

Coupling and Cohesion

Architectural Building blocks:

A good architecture:

Minimizes coupling between modules: Goal: modules don ʼ t need to know much about one another to interact Low coupling makes future change easier Maximizes the cohesion of each module Goal: the contents of each module are strongly inter-related High cohesion means the subcomponents really do belong together module module connector

X 

3 © 2008 Steve Easterbrook. This presentation is available free for non-commercial use with attribution under a creative commons license. Conway ʼ s Law

“The structure of a software system

reflects the structure of the organisation

that built it”

University of Toronto Department of Computer Science

© 2012 Steve Easterbrook. This presentation is available free for non-commercial use with attribution under a creative commons license. 4

People

Socio-Technical Congruence

C

G

B

E

F

D

A

L

H J

K^ I

Modules

See: Valetto, et al., 2007.

© 2012 Steve Easterbrook. This presentation is available free for non-commercial use with attribution under a creative commons license. 7 Application Logic Storage Layer Presentation Layer

Example: 3-layer architecture

Java

AWT

Application

Views

Control

Objects

Business

Logic

Query

Engine

DBMS

File

Managemt

University of Toronto Department of Computer Science

© 2012 Steve Easterbrook. This presentation is available free for non-commercial use with attribution under a creative commons license. 8

UML Packages

We need to represent our architectures

UML elements can be grouped together in packages Elements of a package may be:  other packages (representing subsystems or modules);  classes;  models (e.g. use case models, interaction diagrams, statechart diagrams, etc) Each element of a UML model is owned by a single package

Criteria for decomposing a system into packages:

Different owners who is responsible for working on which diagrams? Different applications each problem has its own obvious partitions; Clusters of classes with strong cohesion e.g., course, course description, instructor, student,… Or: use an architectural pattern to help find a suitable decomposition…

© 2012 Steve Easterbrook. This presentation is available free for non-commercial use with attribution under a creative commons license. 9

java

Package notation

util

util

Date Date

util

java::util

Date

util

Date java::util::Date

named package^ package with list

of contained classes

package containing

a class diagram

package with

qualified name^ nested packages

package with

fully qualified name

University of Toronto Department of Computer Science

© 2012 Steve Easterbrook. This presentation is available free for non-commercial use with attribution under a creative commons license. 10

Towards component-based design

control

Button Check box <> OnOff turnOn() turnOff() isOn() isOff() Furnace::Heater Lighting::Light

© 2012 Steve Easterbrook. This presentation is available free for non-commercial use with attribution under a creative commons license. 13 Application Logic Layer Package Storage Layer Package Presentation Layer Package

Architectural Patterns

E.g. 3 layer architecture: Presentation Layer Application Logic Layer Storage Layer Java AWT Application Windows Control Objects Business Objects Object to JDBC Relational Java SQL

University of Toronto Department of Computer Science

© 2012 Steve Easterbrook. This presentation is available free for non-commercial use with attribution under a creative commons license. 14

Or to show the interfaces…

Application Logic Layer Package Storage Layer Package Presentation Layer Package Java AWT Application Windows Control Objects Business Objects Object to Relational JDBC Java SQL E.g. 3 layer architecture: Presentation Layer Application Logic Layer Storage Layer

© 2012 Steve Easterbrook. This presentation is available free for non-commercial use with attribution under a creative commons license. 15 kernal

Layered Systems

Examples

Operating Systems communication protocols

Interesting properties

Support increasing levels of abstraction during design Support enhancement (add functionality) and re-use can define standard layer interfaces

Disadvantages

May not be able to identify (clean) layers kernal utilities application layer users Source: Adapted from Shaw & Garlan 1996, p25. See also van Vliet, 1999, p281.

University of Toronto Department of Computer Science

© 2012 Steve Easterbrook. This presentation is available free for non-commercial use with attribution under a creative commons license. 16

Open vs. Closed Layered Architecture

closed architecture

Each layer only uses services of the layer immediately below; Minimizes dependencies between layers and reduces the impact of a change.

open architecture

A layer can use services from any lower layer. More compact code, as the services of lower layers can be accessed directly Breaks the encapsulation of layers, so increase dependencies between layers Layer N Layer N- Layer 2 Layer 1 Layer N Layer N- Layer 2 Layer 1

© 2012 Steve Easterbrook. This presentation is available free for non-commercial use with attribution under a creative commons license. 19

Object Oriented Architectures

Examples:

abstract data types

Interesting properties

data hiding (internal data representations are not visible to clients) can decompose problems into sets of interacting agents can be multi-threaded or single thread

Disadvantages

objects must know the identity of objects they wish to interact with

object

object

object

object

object

method invocation method invocation method invocation method invocation Source: Adapted from Shaw & Garlan 1996, p22-3.

This

is

not

UML!

University of Toronto Department of Computer Science

© 2012 Steve Easterbrook. This presentation is available free for non-commercial use with attribution under a creative commons license. 20

Variant: Object Brokers

server

server

broker

client

client

client

Interesting properties

Adds a broker between the clients and servers Clients no longer need to know which server they are using Can have many brokers, many servers.

Disadvantages

Broker can become a bottleneck Degraded performance

This

is

not

UML!

© 2012 Steve Easterbrook. This presentation is available free for non-commercial use with attribution under a creative commons license. 21

Event based (implicit invocation)

Examples

debugging systems (listen for particular breakpoints) database management systems (for data integrity checking) graphical user interfaces

Interesting properties

announcers of events don ʼ t need to know who will handle the event Supports re-use, and evolution of systems (add new agents easily)

Disadvantages

Components have no control over ordering of computations

broadcast

medium

agent agent agent agent announce event announce event listen for event listen for

broadcast event

medium

Source: Adapted from Shaw & Garlan 1996, p23-4. See also van Vliet, 1999 Pp264-5 and p

This

is

not

UML!

University of Toronto Department of Computer Science

© 2012 Steve Easterbrook. This presentation is available free for non-commercial use with attribution under a creative commons license. 22

Repositories

Examples

databases blackboard expert systems programming environments

Interesting properties

can choose where the locus of control is (agents, blackboard, both) reduce the need to duplicate complex data

Disadvantages

blackboard becomes a bottleneck blackboard (shared data) agent agent agent agent agent agent Source: Adapted from Shaw & Garlan 1996, p26-7. See also van Vliet, 1999, p