Architectural Design - UBC Computer Science

advertisement
Material from:
Software Engineering 8, Sommerville
Software Architecture, Shaw and Garlan
ARCHITECTURAL STYLES
This work is licensed under a Creative Commons
Attribution-Noncommercial 2.5 Canada License
Neil Ernst (slides from Eric Wohlstadter, Emmerson Murphy-Hill
and Gail Murphy)
Keep It Real …
Any sufficiently advanced MVC
framework is indistinguishable
from just writing all this *&%$
from scratch to begin with @GonzoHacker
Conway’s Law [1968]
“Any organization that designs a system will
inevitably produce a design whose structure is a
copy of the organization's communication
structure.”
Coplien and Harrison [2004]

"If the parts of an organization (e.g. teams,
departments, or subdivisions) do not closely reflect
the essential parts of the product, or if the
relationship between organizations do not reflect
the relationships between product parts, then the
project will be in trouble. ... Therefore: Make sure
the organization is compatible with the product
architecture."
Eric S. Raymond

“Conway’s Law prov. The rule that organization of
the software and the organization of the software
team will be congruent; originally stated as:
 ‘If
you have four groups working on a compiler, you’ll
get a 4-pass compiler’.” (Raymond, 1996)

E.g. A web team, a DB team, and a business team
produce a 3-tier architecture.
http://www.bonkersworld.net/organizational-charts/
Common Style Categories

Language-influenced



Layered



Virtual Machines
Client-server
Dataflow-styles



Main program and sub-routine
Object-oriented
Batch-sequential
Pipe-and-filter
Shared Memory

Blackboard




Pull-style (repository)
Push-style (publish-subscribe)
Rule-based
Others ….
Layered Styles

Organize system as a stack of consumers and
providers of functions
 Layers


can be both consumer and provider
Layers only know about lower layers
Independence of layers eases evolution
 Layers
are easy to replace
 Changes to one layer only affect small set of
components

Synchronous communication through function calls or
requests
Virtual Machine Style

Layers are decomposed into increasing levels of
abstraction
My Web App
Servlet API
JDK
Operating System
Hardware Drivers
http://en.wikipedia.org/wiki/Semantic_Web_Stack
Abstraction Layers Exercise

Decompose the relevant data-structure for an HTML
Editor into levels of abstraction
GUI Editor Widgets
…
Character Sequence
Byte Sequence
Bit Sequence
Virtual Machine Style


Focus is on Logical View or Development View
Issues
 Sometimes
the best way of decomposing a system is not
related to abstraction!
 Performance can suffer
 Data
must be passed through several layers
Potential VM architecture
for Lunar Lander game
Client-Server Style

Basic style consists of two layers and a network:
A
set of servers
 A set of clients
 A network that allows clients access to servers
Design Issues
in Client-Server Architecture



Focus is on Physical View
Fat Client vs. Thin Client
Pass by Value vs. Pass by Reference
Thin Client



Client software provides GUI only
Good
 Easy to deploy system
 Additional system features easy to add on server only
 Simplicity provides compatibility with many client devices
Bad
 Client can’t do anything without Internet access
 High bandwidth usage and latency
 High throughput demand on server
 Clients never perform computation themselves
 Large scalability demands on server
MS Outlook
Fat Client



Client software provides GUI + Algorithms
Server mostly a data repository
Good
 Client can do some work without Internet access
 Computation is amortized across clients

Network access is infrequent
Bad
 Complexity inhibits compatibility with many client devices


Server gets a break
Pass by Value




Data returned to client using “deep” copy
Object fields are included in response (recursively)
Good
 Reduced latency
Bad
 Potential wasteful bandwidth
 Too much data may prevent interactive responsiveness
Pass by Value (JSON example)
{
auctionID: 4935;
description: “iPod nano”;
price: 24.54;
endDate: “9-30-2011”;
seller: {
name: “S. Jobs”;
street: “1 Infinite Loop”;
city: “Cupertino”;
}
}
Pass by Reference




Data returned to client using “shallow” copy
Object fields are translated into IDs
Good
 Reduced bandwidth
Bad
 Too many trips to retrieve data may prevent interactive
responsiveness
Pass by Reference (JSON)
{
auctionID: 4935;
description: “iPod nano”;
price: 24.54;
endDate: “9-30-2011”;
sellerID: 9984;
}
http://en.wikipedia.org/wiki/Multitier_architecture
N-Tier Architecture
Model View Controller


Look at RoR architecture (rails
What is the difference between 3-tier and MVC?
 State-Logic-Display
State (DB)
and Display

App
Server
Display
(browser)
– no interaction between State and
Design Review Signups



Send course e-mail available times
All members must attend
Include at least one 30 minute block for each day,
between 9pm and 6pm
 Oct.

15th, Oct 16th, and Oct 17th
I will then schedule everyone and post a Google
spreadsheet with the details.
Design Review ~20 mins



Each team member should contribute.
One possible timeline
~3 mins:


high-level overview
~5 mins x 3:
Describe a few related User Stories by …

Showing how the story corresponds to HTML UI

Showing how the story corresponds to Class diagram

Last 5 minutes: Q&A with me / TA
Download