Docsity

GoV Patterns for Software Architecture-Patterns in Software Engineering-Lecture 7 Slides-Computer Engineering, Slides of Software Engineering

Partial preview of the text

Download GoV Patterns for Software Architecture-Patterns in Software Engineering-Lecture 7 Slides-Computer Engineering and more Slides Software Engineering in PDF only on Docsity!

Patterns inSoftware EngineeringSoftware Engineering Lecturer: Raman RamsinLecturer:

Raman Ramsin

Lecture 7 GoV Patterns โ€“ Architectural

P^ t 1

Department of Computer Engineering

1

Sharif University of Technology

Part 1

Patterns in Software Engineering โ€“ Lecture 7 GoV Patterns for Software Architecture^ A^ di

t^ B

h^

t^ l

ย„^ According to Buschmann et al.:^

^ A

pattern for software architecture describes a particular recurringp^

p^
g
design problem that arises in specific design contexts, andpresents a well-proven generic scheme for its solution.

The solution scheme is specified by describing^ ย„^ the constituent components^ ย„^ The responsibilities and relationships of the componentsย„^ The responsibilities and relationships of the components^ ย„^ the ways in which the components collaborate.

Department of Computer Engineering

2

Sharif University of Technology

Patterns in Software Engineering โ€“ Lecture 7 GoV Patterns: Categories ย„ Architectural^

^ Expresses a fundamental structural organization schema for software ^ Expresses

a fundamental structural organization schema for software
systems.^ ย„^ Provides a set of predefined subsystems (or components), specifies theirresponsibilities, and includes rules and guidelines for organizing thel ti^

hi^ b t^

th relationships between them.

ย„^ Design^

^ Provides a scheme for refining the subsystems or components of asoftware system

or the relationships between them
software system, or the relationships between them.^ ย„^ Describes a commonly-recurring structure of communicating components thatsolves a general design problem within a particular context. ย„ Idiom ย„ Idiom

Low-level pattern specific to a programming language.^ ย„^ Describes how to implement particular aspects of components or therelationships between them using the features of the given language.

Department of Computer Engineering

4

Sharif University of Technology

Patterns in Software Engineering โ€“ Lecture 7 Architectural Patterns: Categories ย„ From Mud to Structure^

^ Support a controlled decomposition of a system task into cooperating subtasks.pp

p^

y^

p^ g

^ Layers,

Pipes and Filters, and

Blackboard

ย„^ Distributed Systems^

^ Deal with the infrastructure of distributed applications ^ Deal

with the infrastructure of distributed applications. Broker; alsoMicrokernel and

Pipes and Filters, which only consider distribution as a

secondary concern. ย„ Interactive Systems ย„ Interactive^
Systems

^ Support the structuring of systems that feature human-computer interaction. ^ Model-View-Controller and

Presentation-Abstraction-Control

Ad^ t^ bl
S^ t
ย„^ Adaptable Systems^

^ Support extension of applications and their adaptation to evolving technology andchanging functional requirements.^ ^ Reflection and

Microkernel Department of Computer Engineering

5

Sharif University of Technology

^ Reflection

and^ Microkernel

Patterns in Software Engineering โ€“ Lecture 7 From Mud to Structure: Layers ย„ Helps to structure applications that can be decomposed into groupsof subtasks in which each group of subtasks is at a particular level ofof subtasks in which each group of subtasks is at a particular level ofabstraction. Department of Computer Engineering

7

Sharif University of Technology

Patterns in Software Engineering โ€“ Lecture 7 From Mud to Structure: Layers ย„ Context -

A large system that requires decomposition.
ย„^ Problem -
Forces are as follows:

^ Late source code changes should not ripple through the system.

g^

pp^

g^ y

^ Interfaces should be stable. ^ Parts of the system should be exchangeable. ^ It may be necessary to build other systems at a later date with the same low-levelissues as the system you are currently designingissues as the system you are currently designing. ^ Similar responsibilities should be grouped to help understandability andmaintainability. ^ There is no 'standard' component granularity. ^ Complex components need further decomposition. ^ Crossing component boundaries may impede performance. ^ The system will be built by a team of programmers, and work has to be subdividedalong clear boundariesDepartment of Computer Engineering

8

Sharif University of Technology

along^ clear boundaries.

Patterns in Software Engineering โ€“ Lecture 7 Layers: Dynamics ย„ Scenario I:

Top-down communication initiated by a client.
ย„^ Scenario II:
Bottom-up communication, when a chain of actions
starts at Layer 1; for example when a device driver detects input. ย„ Scenarios III and IV:
Requests only travel through a subset of the
layers.^

^ III: A top level request may only go to level N 1 lf this level can satisfy ^ III: A top-level request may only go to level N-1 lf this level can satisfythe request; e.g. when level N-1 acts as a cache.^ ^ IV: A bottom-level request may only travel through the next few upper-level layers.e e^

aye s
ย„^ Scenario V:
involves two stacks of N layers communicating with
each otherDepartment of Computer Engineering

10

Sharif University of Technology

each^ other.

Patterns in Software Engineering โ€“ Lecture 7 Layers: Consequences 9 Reuse of layers 9 Support for standardization 9 Dependencies are kept local 9 Exchangeability

d^ f^

h^

b h

8 Cascades of changing behavior 8 Lower efficiency 8 Potential for unnecessary work 8 Difficulty of establishing the correct granularity of layersDepartment of Computer Engineering

11

Sharif University of Technology

Patterns in Software Engineering โ€“ Lecture 7 From Mud to Structure: Pipes and Filters ย„ Context -

Processing data streams.
ย„^ Problem -
Forces are as follows:

^ Future system enhancements should be possible by exchanging processingsteps or by recombination of steps, even by users. ^ Small processing steps are easier to reuse in different contexts than largeones. ^ Non adjacent processing steps do not share information ^ Non-adjacent processing steps do not share information. ^ Different sources of input data exist. ^ It should be possible to present or store final results in various ways. ^ Explicit storage of intermediate results for further processing in files clutters ^ Explicit storage of intermediate results for further processing in files cluttersdirectories and is error-prone, if done by users. ^ You may not want to rule out multi-processing the steps, for example runningthem in parallel.Department of Computer Engineering

13

Sharif University of Technology

Patterns in Software Engineering โ€“ Lecture 7 Pipes and Filters: Structure Department of Computer Engineering

14

Sharif University of Technology

Patterns in Software Engineering โ€“ Lecture 7 Pipes and Filters: Structure

  • Sources and Sinks
ย„^ The^ data source
represents the input to the system, and provides af d t l^
f th^
t^ t^
t
sequence of data values of the same structure or type.^ ย‰^ Examples of such data sources are a file consisting of lines of text, or asensor delivering a sequence of numbers.Th^ d t^
i k^ ll^
t^ th^
lt^ f^
th^ d^
f th^ i^
li
ย„^ The^ d
ata sink^
collects the results from the end of the pipeline.

Department of Computer Engineering

16

Sharif University of Technology

Patterns in Software Engineering โ€“ Lecture 7 Pipes and Filters: Dynamics โ€“ Scenario I ย„ Push pipeline in which activity starts with the data source. Filteractivity is triggered by writing data to the passive filters. Department of Computer Engineering

17

Sharif University of Technology

Patterns in Software Engineering โ€“ Lecture 7 Pipes and Filters: Dynamics โ€“ Scenario III ย„ mixed push-pull pipeline with passive data source and sink.

p^ p^

p p^

p

Department of Computer Engineering

19

Sharif University of Technology

Patterns in Software Engineering โ€“ Lecture 7 Pipes and Filters: Dynamics โ€“ Scenario IV ย„ All filters actively pull, compute. and push data in a loop.

y p^ ,^

p^

p^

p

Department of Computer Engineering

20

Sharif University of Technology