software architectures
DESCRIPTION
18 October 2010. Software architectures. Team Meetings. All team meetings for this week are cancelled (If you WANT to meet, I will) Beginning next week, demo required at EVERY meeting. Patterns. What is a Pattern?. A solution to a problem in a context - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Software architectures](https://reader035.vdocuments.mx/reader035/viewer/2022070501/56816949550346895de0dd41/html5/thumbnails/1.jpg)
18 October 2010
SOFTWARE ARCHITECTURES
![Page 2: Software architectures](https://reader035.vdocuments.mx/reader035/viewer/2022070501/56816949550346895de0dd41/html5/thumbnails/2.jpg)
Team Meetings
All team meetings for this week are cancelled(If you WANT to meet, I will)
Beginning next week,demo required at EVERY meeting
![Page 3: Software architectures](https://reader035.vdocuments.mx/reader035/viewer/2022070501/56816949550346895de0dd41/html5/thumbnails/3.jpg)
Patterns
![Page 4: Software architectures](https://reader035.vdocuments.mx/reader035/viewer/2022070501/56816949550346895de0dd41/html5/thumbnails/4.jpg)
What is a Pattern? A solution to a problem in a context A structured way of representing design
information in prose and diagrams A way of communicating design
information from an expert to a novice Requirement: shows when and how to
apply
![Page 5: Software architectures](https://reader035.vdocuments.mx/reader035/viewer/2022070501/56816949550346895de0dd41/html5/thumbnails/5.jpg)
Origin of Patterns Came from the field of (building) architecture
Christopher Alexander, late 70sThe Timeless Way of Building (1979)
DescribesCommon architectural motifsHow they come together to form a cohesive,
livable environmentPatterns from town planning to decorative detail
current architectural methods result in products that fail to meet the real demands and requirements of its users, society and its individuals, and are unsuccessful in fulfilling the quintessential purpose of all design and engineering endeavors: to improve the human condition – Christopher Alexander
![Page 6: Software architectures](https://reader035.vdocuments.mx/reader035/viewer/2022070501/56816949550346895de0dd41/html5/thumbnails/6.jpg)
Architectural Example: Door Placement
If room has two doors and people move through it, keep both doors at one end of the room
![Page 7: Software architectures](https://reader035.vdocuments.mx/reader035/viewer/2022070501/56816949550346895de0dd41/html5/thumbnails/7.jpg)
Alexander’s PatternsEntries have five parts: Name: A short familiar, descriptive name or phrase, usually more
indicative of the solution than of the problem or context. Example: One or more pictures, diagrams, and/or descriptions that
illustrate prototypical application. Context: Delineation of situations under which the pattern applies. Problem: A description of the relevant forces and constraints, and how
they interact. Solution: Static relationships and dynamic rules describing how to
construct artifacts in accord with the pattern, often listing several variants.
What do you need to change for software?
![Page 8: Software architectures](https://reader035.vdocuments.mx/reader035/viewer/2022070501/56816949550346895de0dd41/html5/thumbnails/8.jpg)
Properties of Patterns Independent, specific, and formulated precisely enough to make
clear when they apply (encapsulation) Describes how to build a realization (generativity) Identifies a solution space containing an invariant that minimizes
conflict among constraints (equilibrium) Represent abstractions of empirical experience and everyday
knowledge (abstraction) May be extended down to arbitrarily fine levels of detail. Like
fractals, patterns have no top or bottom (openness) Hierarchically related. Coarse grained patterns are layered on top
of, relate, and constrain fine grained ones (composibility)
What do you need to change for software?
![Page 9: Software architectures](https://reader035.vdocuments.mx/reader035/viewer/2022070501/56816949550346895de0dd41/html5/thumbnails/9.jpg)
Design Patterns All the same benefits are true in software
Cunningham and Beck recognized in late 80sCommunity formed in early 90s
The Book:Gamma, Helm, Johnson and Vlissides, Design Patterns:
Elements of Reusable Object-Oriented Software (1995)Define 23 patternsThree categories:
○ Structural – ways to represent ensembles of information
○ Creational – creating complex objects○ Behavioral – capturing the behavior of object
![Page 10: Software architectures](https://reader035.vdocuments.mx/reader035/viewer/2022070501/56816949550346895de0dd41/html5/thumbnails/10.jpg)
Patterns Exist at All Levels Machine code Assemblers High Level Languages Abstract Data Types (queues, stacks) Objects Patterns Software Architectures
![Page 11: Software architectures](https://reader035.vdocuments.mx/reader035/viewer/2022070501/56816949550346895de0dd41/html5/thumbnails/11.jpg)
Software Architectures
![Page 12: Software architectures](https://reader035.vdocuments.mx/reader035/viewer/2022070501/56816949550346895de0dd41/html5/thumbnails/12.jpg)
Categorizing Software Architectures(Shaw and Garlan)
Model-View Controller Data flows
Viewed as data flowing among processes Independent components
Components operating in parallel and communicating occasionally Virtual machines
Treats an application as a program written in a special-purpose language
Layered architectures Packages of function with a strong hierarchical uses relationship
Repository Application built around data
![Page 13: Software architectures](https://reader035.vdocuments.mx/reader035/viewer/2022070501/56816949550346895de0dd41/html5/thumbnails/13.jpg)
Why Categorize? Recognize patterns Reuse designs Learn from other similar applications Reuse classes Simplify communication
![Page 14: Software architectures](https://reader035.vdocuments.mx/reader035/viewer/2022070501/56816949550346895de0dd41/html5/thumbnails/14.jpg)
Examples of Use (real quotes) … is based on the client-server model and uses
remote procedure calls ... Abstraction layering and system decomposition
provide the appearance of system uniformity to clients …
The architecture encourages a client server model …
We have chosen a distributed, object-oriented approach
The easiest way … is to pipeline the execution …
![Page 15: Software architectures](https://reader035.vdocuments.mx/reader035/viewer/2022070501/56816949550346895de0dd41/html5/thumbnails/15.jpg)
Well-known Architectures
![Page 16: Software architectures](https://reader035.vdocuments.mx/reader035/viewer/2022070501/56816949550346895de0dd41/html5/thumbnails/16.jpg)
Model-View-Controller
Originally designed for SmallTalkEarly OO language
(1970’s) Steve Burbeck, 1987 First paper
![Page 17: Software architectures](https://reader035.vdocuments.mx/reader035/viewer/2022070501/56816949550346895de0dd41/html5/thumbnails/17.jpg)
Data Flow Design Data flowing among processes Two categories:
Pipes and filters○ Filters: processes○ Pipes: input streams
Batch sequential○ Pipe and filter where input streams are
batches of data
![Page 18: Software architectures](https://reader035.vdocuments.mx/reader035/viewer/2022070501/56816949550346895de0dd41/html5/thumbnails/18.jpg)
Pipe and Filter
filterfilter
filter
filter filter
filter
pipe
pipeFilters: processesPipes: input streams
![Page 19: Software architectures](https://reader035.vdocuments.mx/reader035/viewer/2022070501/56816949550346895de0dd41/html5/thumbnails/19.jpg)
Example of Batch Sequential
Collectmortgage funds
Accountbalances
Mortgagepool
Unsecuredpool
Collectunsecured funds
Pipe: batch input
Processes
Pipe and filter where input streams are batches of data
![Page 20: Software architectures](https://reader035.vdocuments.mx/reader035/viewer/2022070501/56816949550346895de0dd41/html5/thumbnails/20.jpg)
Independent Components Components
operating in parallel communicating occasionally
Different typesClient-serverParallel communicating processesEvent systemsService Oriented Architecture
![Page 21: Software architectures](https://reader035.vdocuments.mx/reader035/viewer/2022070501/56816949550346895de0dd41/html5/thumbnails/21.jpg)
Client-Server and Facade
«not exposed»
P
«not exposed»
Façade«exposed»Client
1
2
«not exposed»
«not exposed»
«not exposed»
Adapted from Software Engineering: An Object-Oriented Perspective by Eric J. Braude (Wiley 2001), with permission.
Key concept: limit exposed interface
Browser-web server most familiar example:Separate systems with narrow interface
![Page 22: Software architectures](https://reader035.vdocuments.mx/reader035/viewer/2022070501/56816949550346895de0dd41/html5/thumbnails/22.jpg)
Parallel Communicating Processes
Adapted from Software Engineering: An Object-Oriented Perspective by Eric J. Braude (Wiley 2001), with permission.
Customer:customer n
withdraw
Customer:customer n+1
Session:session k
Session:session m
depositcreate
Account:customer n+1 saving
Account:customer nchecking
create retrieve
retrieve
3 types of processes, 2 instances of eachDuration of process
processes
actions
sequence diagram
![Page 23: Software architectures](https://reader035.vdocuments.mx/reader035/viewer/2022070501/56816949550346895de0dd41/html5/thumbnails/23.jpg)
Observer Design Pattern
Gamma et al
Sourcenotify()
Observerupdate()
ConcreteSubjectstate
ConcreteObserverobserverState
update()
Client of thissystem
1
2
3
1..nRequest others be notified
Notify all observers
Determines if change needed
Single source of data with a number of clients that need to be updated
![Page 24: Software architectures](https://reader035.vdocuments.mx/reader035/viewer/2022070501/56816949550346895de0dd41/html5/thumbnails/24.jpg)
Event Systems and State Transition Diagrams
Set of components waiting for inputSet of components waiting for input
![Page 25: Software architectures](https://reader035.vdocuments.mx/reader035/viewer/2022070501/56816949550346895de0dd41/html5/thumbnails/25.jpg)
Services Oriented Architecture Collection of services
Direct communicationCoordinating service
Different technologiesEarly ones: DCOM CORBA (brokers)Web Services
○ Lots of different models and tools: REST (REpresentational State Transfer using HTTP just one)
![Page 26: Software architectures](https://reader035.vdocuments.mx/reader035/viewer/2022070501/56816949550346895de0dd41/html5/thumbnails/26.jpg)
Virtual machines Treats an application as a program
written in a special language Payoff is that the interpreter code is the
basis for multiple applications Two types
Interpreters (JVM)Rule-based systems (AI)
![Page 27: Software architectures](https://reader035.vdocuments.mx/reader035/viewer/2022070501/56816949550346895de0dd41/html5/thumbnails/27.jpg)
Layered Architecture: Network
OSI TCP/IP
![Page 28: Software architectures](https://reader035.vdocuments.mx/reader035/viewer/2022070501/56816949550346895de0dd41/html5/thumbnails/28.jpg)
Layered Architecture
Role-playing game layer
Characters LayoutRolePlayingGame
EncounterCharacters
EncounterEnvironment
Encounter Game
Application layer
3D engine layer
«uses»
«uses»
Adapted from Software Engineering: An Object-Oriented Perspective by Eric J. Braude (Wiley 2001), with permission.
Coherent collection of software artifacts, typically a package of classes
![Page 29: Software architectures](https://reader035.vdocuments.mx/reader035/viewer/2022070501/56816949550346895de0dd41/html5/thumbnails/29.jpg)
Repository A system built around data Two types
DatabasesHypertext systems
![Page 30: Software architectures](https://reader035.vdocuments.mx/reader035/viewer/2022070501/56816949550346895de0dd41/html5/thumbnails/30.jpg)
A Typical Repository System
Database
DBMS
GUI
Analysisprocess
1
Analysisprocess
n…...…...
Control
Adapted from Software Engineering: An Object-Oriented Perspective by Eric J. Braude (Wiley 2001), with permission.
![Page 31: Software architectures](https://reader035.vdocuments.mx/reader035/viewer/2022070501/56816949550346895de0dd41/html5/thumbnails/31.jpg)
Hypertext: Basis of the Web
Motivated by Vannevar Bush in 1945“As We May Think” (Atlantic Monthly)Theoretical machine, "memex," to enhance
human memory by allowing the user to store and retrieve documents linked by associations
Invented by Ted Nelson in the 1960s Popularized with HTML (Tim Berners-Lee)
![Page 32: Software architectures](https://reader035.vdocuments.mx/reader035/viewer/2022070501/56816949550346895de0dd41/html5/thumbnails/32.jpg)
Ted Nelson "If computers are the wave of the future,
displays are the surfboards." Xanadu: 1974
"give you a screen in your home from which you can see into the world's hypertext libraries... offer high-performance computer graphics and text services at a price anyone can afford... allow you to send and receive written messages... [and] make you a part of a new electronic literature and art, where you can get all your questions answered...“
Computer Lib/Dream MachinesFor more details, see pdf
![Page 33: Software architectures](https://reader035.vdocuments.mx/reader035/viewer/2022070501/56816949550346895de0dd41/html5/thumbnails/33.jpg)
SummaryModel-View-ControllerData flow systems Pipes and filters
Batch sequentialIndependent components Client-server
Parallel communicating processes
Event systems Service Oriented Architecture
Virtual machines Interpreters Rule-based systems
Layered architecturesRepositories Databases
Hypertext systems