1 software architecture cs 414, software engineering i mark ardis, rose-hulman institute january 14,...

Post on 20-Dec-2015

214 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

1

Software Architecture

CS 414, Software Engineering I

Mark Ardis, Rose-Hulman Institute

January 14, 2003

2

Outline

Definitions of Architecture

Architectural Styles

Patterns

3

Definitions of Architecture (1)

1. The art and science of designing and erecting buildings.

2. Buildings and other large structures: “the low, brick-and-adobe architecture of the Southwest.”

American Heritage® Dictionary of the English Language: Fourth Edition. 2000.

4

Definitions of Architecture (2)

3. A style and method of design and construction: “Byzantine architecture.”

4. Orderly arrangement of parts; structure: “the architecture of the federal bureaucracy; the architecture of a novel.”

American Heritage® Dictionary of the English Language: Fourth Edition. 2000.

5

Definitions of Architecture (3)

5. Computer Science The overall design or structure of a computer system, including the hardware and the software required to run it, especially the internal structure of the microprocessor.

American Heritage® Dictionary of the English Language: Fourth Edition. 2000.

6

Software Architecture

Global control

Communication, synchronization and data access

Assignment of functionality to design elements

Composition of design elements

Scaling and performance

7

Outline

Definitions of Architecture

Architectural Styles

Patterns

8

Architectural Styles (1)

Dataflow Batch sequential Pipes and filters

Call-and-return Main program and subroutine OO systems Hierarchical layers

9

Architectural Styles (2)

Independent components Communicating processes Event systems

Virtual machines Interpreters Rule-based systems

10

Architectural Styles (3)

Data-centered Databases Hypertext systems Blackboards

11

Blackboard Architecture

Knowledge sources separate and independent

Blackboard data structure problem-solving state knowledge sources update it

Control driven by state of blackboard

12

Blackboard Example

Blackboard(shared data)

ks1 ks2

ks3

ks4

ks5

ks6

ks7

13

Pipe and Filter Architecture

Filters

Pipes

14

Examples of Pipe-and-Filter

Unix shell scripts

Compilers lexical analysis, parsing, semantic

analysis, code generation

Batch sequential degenerate case where all input processed

before any output

15

Layered Architecture

Core

Utilities

Applications

16

Interpreter Architecture

InterpreterEngine

Program

Data Output

17

Architecture Review Boards

Review Architectural Specifications

Provide shared knowledge across projects

Prevent mistakes early

18

First Cartoon of the Day

19

Outline

Definitions of Architecture

Architectural Styles

Patterns

20

Christopher Alexander

Architect who proposed that people design their own dwellings, using accepted patterns of designWrote a series of books that influenced the OO community

21

A Place to Wait (1/3)

The process of waiting has inherent conflicts in it.

On the one hand, whatever people are waiting for---the doctor, an airplane---has built-in uncertainties, which make it inevitable that they must spend a long time hanging around, waiting, doing nothing.

22

A Place to Wait (2/3)

On the other hand, they cannot usually afford to enjoy this time. Since they never know when their turn will come, they cannot even take a stroll or sit outside.

23

A Place to Wait (3/3)

Therefore:In places where people end up waiting,

create a situation which makes the waiting positive. Fuse the waiting with some other activity---newspaper, coffee, pool tables; something which draws people in who are not simply waiting. And also the opposite: make a place which can draw a person waiting into a reverie; quiet; a positive silence.

24

History of Software Patterns

Kent Beck had read Alexander's work while in collegeKent convinced Ward Cunningham that ideas were goodThey helped a group design a user interface by letting users design it (1987)

25

Beck and Cunningham's Original Patterns

Window Per TaskFew PanesStandard PanesNouns and VerbsShort Menus

26

Window Per Task

Make a specific window for each task the user must perform. All of the information needed to complete a task should be available in the Few Panes of the window. Assume prerequisite tasks have been completed (if they haven't, the user will simply change windows).

27

Few Panes

To understand complex things one often must see it from several points of view. Therefore: Provide these points of view by dividing the area of your Window Per Task into panes.

28

Standard Panes

One must learn to operate each kind of pane offered in the Few Panes of every window. Therefore: Cast each pane into the format offered by one of a few standard panes. [Tektronix had 4.]

29

Nouns and Verbs

Things exist while action happens. Therefore: Put lists of things (nouns) in a list pane (one of Few Panes) which persists through interactions. Put actions (verbs) in Short Menus which pop up and then disappear as the action commences.

30

Short Menus

The elements of a pop-up menu must be visually searched repeatedly. Therefore: Make them short, fixed and single-level.

31

What is a Pattern?

"a named nugget of insight that conveys the essence of a proven solution to a recurring problem within a certain context amidst competing concerns"

"a solution to a problem in a context"

32

Pattern Parts

NameProblem descriptionContext: when is it applicable?Forces: what are the tradeoffs?SolutionConsequences...

33

A Good Pattern

solves a problemis a proven conceptdescribes a relationshiphas a significant human componentprovides a solution that isn't obvious

34

Qualities of a Pattern

Encapsulation and abstractionOpenness and variabilityGenerativity and composabilityEquilibrium

35

Leaky Bucket Counters (1/2)

Problem: How do you deal with transient faults?

Context: Fault-tolerant software that must deal with failure events.

Forces: You want a hardware module to exhibit hard

failures before taking drastic action. Some failures come from the environment,

and should not be blamed on the device.

36

Leaky Bucket Counters (2/2)

Solution: A failure group has a counter that is incremented for each failure. Each counter is decremented periodically. A hard failure is not reported until the counter exceeds a threshold.

Consequences: Hard errors are handled, but transient errors are not as likely to trigger error handling.

37

Second Cartoon of the Day

38

Writers' Workshops

Method of publishing patternsProcess:

1. Author reads a short segment2. Others provide constructive criticism

while author remains silent3. Group thanks author (applause)

39

Pattern Mining

Interview experts about their domainRecord patterns that are foundShare resulting set with experts

40

Advantages of Patterns

Shorten discoveryAvoid inexpert design decisionsReuse large chunks of design

41

References

Gamma, Helm, Johnson and Vlissides Design Patterns, Addison-Wesley 1995, ISBN 0-201-63361-2. (Gang of Four)

Jim Coplien, Software Patterns Management Briefing, 1996, http://www.bell-labs.com/user/cope/Patterns/WhitePaper

Appleton, Brad

Patterns and Software: Essential Concepts and Terminology, 2000

http://www.cmcrossroads.com/bradapp/docs/patterns-intro.html

42

Books by Alexander

Notes on the Synthesis of Form, Harvard University Press, 1964

The Oregon Experiment, Oxford University Press, 1975

A Pattern Language: Towns, Buildings, Construction, Oxford University Press, 1977

The Timeless Way of Building, Oxford University Press, 1979

top related