Lecture 7 - Tuesday, October 5 2010.
Material and some slide content from:- Emerson Murphy-Hill- Software Architecture: Foundations, Theory, and Practice- Essential Software Architecture
Architectural Styles - FinaleReid Holmes
REID HOLMES - SE2: SOFTWARE DESIGN & ARCHITECTURE
ArchitecturalStyles
LanguageBased
Layered Dataflow
SharedMemory
InterpreterImplicit
Invocation
Peer-to-Peer
Main program &Subroutines
Object-oriented
VirtualMachine
ClientServer
Batch-sequential
Pipe-and-Filter
Blackboard
Rule-based Interpreter
Mobilecode
Publish-subscribe
Event-based
[TOPOLOGY FROM TAILOR ET AL.]
REID HOLMES - SE2: SOFTWARE DESIGN & ARCHITECTURE
Implicit invocation‣ In contrast to other patterns, the flow of control is
“reversed”.
‣ Commonly integrate tools in shared environments.
‣ Components tend to be loosely coupled.
‣ Often used in:
‣ UI applications (e.g., MVC, MVP).
‣ Enterprise systems (e.g., WebSphere)
REID HOLMES - SE2: SOFTWARE DESIGN & ARCHITECTURE
Style: Event-based
REID HOLMES - SE2: SOFTWARE DESIGN & ARCHITECTURE
‣ Independent components asynchronously emit and receive events.
‣ Components:
‣ Event generators / consumers.
‣ Connections:
‣ ?
‣ Data elements:
‣ Events.
‣ Topology:
‣ ?
[TAILOR ET AL.]
Style: Event-based
REID HOLMES - SE2: SOFTWARE DESIGN & ARCHITECTURE
‣ Variants:
‣ May be push or pull based (with event bus).
‣ Qualities:
‣ ?
‣ Typical uses:
‣ User interfaces. Widely distributed applications (e.g., financial markets, sensor networks).
‣ Cautions:
‣ ?
[TAILOR ET AL.]
Style: Event-based
REID HOLMES - SE2: SOFTWARE DESIGN & ARCHITECTURE
Style: Publish-subscribe
REID HOLMES - SE2: SOFTWARE DESIGN & ARCHITECTURE
‣ Subscribers register for specific messages or content. Publishers maintain registrations and broadcast messages to subscribers as required.
‣ Components:
‣ ?
‣ Connections:
‣ Typically network protocols.
‣ Data elements:
‣ Subscriptions, notifications, content.
‣ Topology:
‣ Subscribers connect to publishers either directly or through intermediaries.
[TAILOR ET AL.]
Style: Publish-subscribe
REID HOLMES - SE2: SOFTWARE DESIGN & ARCHITECTURE
‣ Variants:
‣ Complex matching of subscribers and publishers can be supported via intermediaries.
‣ Qualities:
‣ ?
‣ Typical uses:
‣ News, GUI programming, network games.
‣ Cautions:
‣ Scalability to large numbers of subscriber may require specialized protocols.
[TAILOR ET AL.]
Style: Publish-subscribe
REID HOLMES - SE2: SOFTWARE DESIGN & ARCHITECTURE
Interpreter‣ Interpret commands on the fly.
‣ Based on a virtual machine produced in SW.
‣ Components are the ‘program’, its data, its state, and the interpretation engine.
‣ e.g., Java Virtual Machine. JVM interprets Java bytecode).
REID HOLMES - SE2: SOFTWARE DESIGN & ARCHITECTURE
Style: Interpreter
REID HOLMES - SE2: SOFTWARE DESIGN & ARCHITECTURE
Style: Interpreter‣ Update state by parsing and executing commands.
‣ Components:
‣ ?
‣ Connections:
‣ Components tightly bound; uses procedure calls and shared state.
‣ Data elements:
‣ Commands.
‣ Topology:
‣ Tightly coupled three-tier.
[TAILOR ET AL.]
REID HOLMES - SE2: SOFTWARE DESIGN & ARCHITECTURE
‣ Qualities:
‣ ?
‣ Typical uses:
‣ End-user programming.
‣ Cautions:
‣ May not be performant.
Style: Interpreter[TAILOR ET AL.]
REID HOLMES - SE2: SOFTWARE DESIGN & ARCHITECTURE
Style: Mobile code
REID HOLMES - SE2: SOFTWARE DESIGN & ARCHITECTURE
‣ Code and state move to different hosts to be interpreted.
‣ Components:
‣ ?
‣ Connections:
‣ Network protocols.
‣ Data elements:
‣ Representations of code, program state, data.
‣ Topology:
‣ Network.
[TAILOR ET AL.]
Style: Mobile code
REID HOLMES - SE2: SOFTWARE DESIGN & ARCHITECTURE
‣ Variants:
‣ Code-on-demand, remote evaluation, and mobile agent.
‣ Qualities:
‣ Dynamic adaptability.
‣ Typical uses:
‣ ?
‣ Cautions:
‣ Security. Transmission costs. Network reliability.
[TAILOR ET AL.]
Style: Mobile code
REID HOLMES - SE2: SOFTWARE DESIGN & ARCHITECTURE
Peer-to-peer
REID HOLMES - SE2: SOFTWARE DESIGN & ARCHITECTURE
Style: Peer-to-peer‣ State and behaviour are distributed among peers that
can act as clients or servers.
‣ Components:
‣ Peers (aka independent components).
‣ Connections:
‣ Network protocols.
‣ Data elements:
‣ Network messages.
‣ Topology:
‣ ?
[TAILOR ET AL.]
REID HOLMES - SE2: SOFTWARE DESIGN & ARCHITECTURE
‣ Qualities:
‣ ?
‣ Typical uses:
‣ When information and operations are distributed.
‣ Cautions:
‣ Security. Time criticality.
Style: Peer-to-peer[TAILOR ET AL.]
REID HOLMES - SE2: SOFTWARE DESIGN & ARCHITECTURE
Architectural representations‣ Characteristics of representations:
‣ Ambiguity: ?
‣ Accuracy: Correct within tolerances.
‣ Precision: Exact but not necessarily correct.
‣ Architectural models can be overwhelming.
‣ Model individual concerns with unique views.
‣ Views overlap and can be consistent on inconsistent.
REID HOLMES - SE2: SOFTWARE DESIGN & ARCHITECTURE
Statechart diagram‣ More formal description of system behaviour.
‣ Poor mapping between states and components.
REID HOLMES - SE2: SOFTWARE DESIGN & ARCHITECTURE
Component diagram‣ Captures components and relationships.
‣ Required and provided APIs explicitly recorded.
REID HOLMES - SE2: SOFTWARE DESIGN & ARCHITECTURE
Deployment diagram‣ Provide mapping between physical devices.
REID HOLMES - SE2: SOFTWARE DESIGN & ARCHITECTURE
Sequence diagram‣ Focus on inter-component collaboration.
‣ Capture behaviour for specific scenarios.
REID HOLMES - SE2: SOFTWARE DESIGN & ARCHITECTURE
Activity‣ List the major components and connectors for
your system.
‣ Create a basic statechart for your system.
‣ Create a rough component and deployment diagram for two different architectures.
‣ Choose the arch that you think is best for your task; you will motivate this decision to me.
‣ Perform an inter-group architectural review; be critical.