Software Archictecture
Software Archictecture
Classes/
Objects
Meth lowest
ods level
Source
code
Software is not one long list of program statements but it has
structure
The above is a taxonomy of structural parts (abstraction hierarchy),
but not representation of relationships between the parts and does not
specify the function of each part
The hierarchy shows a taxonomy of the system parts, but not the procedure for
decomposing the system into parts — how do we do it?
But first, why do we want to decompose
Why We Want ToDecompose
Systems
Tackle complexity by “divide-and-conquer”
See if some parts already exist & can be reused
Focus on creative parts and avoid “reinventing
the wheel”
Support flexibility and future evolution by
decoupling unrelated parts, so each can evolve
separately (“separation of concerns”)
Create sustainable strategic advantage
Software Architecture Definition
Software Architecture =a set of high-level decisions that
determine the structure of the solution(parts of system-to-be
and their relationships)
Principal decisions made throughout the development and
evolution of a software system
made early and affect large parts of the system (“design
philosophy”) — such decisions are hard to modify later
Decisions to use well-known solutions that are proven to work
for similar problems
Software Architecture is not a phase of development
Does not refer to a specific product of a particular phase of
the development process (labeled “high-level design” or
“product design”)
Example Architectural Decisions
Example
Safe Home Access
System
decisions:
Subsyst Subsyste Subsyste
Decision on
em for m for m for
device administr remote system
control ation data decomposition
access
On On On user’s Decision on
embedde office smartphon mapping software-
d deskto e to-hardware
computer p (…and
Web?) Decision on
development platform
or operating system
(Android vs. iOS, etc.)
Decision on how to
fit the subsystems
together
Such decisions are made early on,
(“architecture
style”)
perhaps while discussing the requirements with the customer
to decide which hardware devices will be used for user interaction and
device control
Architectural Decisions—A matter
of scope
product line
product or architecture
system decisions
architecture systemic
decisions Product line impact
scope
Product/system A Product B
scope scope
Subsystem
scope local
Class
scope impact
Dependency View
How parts relate to one another
Layered View
Special case of dependency view
Class View
“domain model” in OOA and “class diagram” in OOD
Component and Connector Views
Process View
Defined sequence of activities?System represented as a
series of communicating processes
Concurrency View
Client/Server View
E.g., in Web browsing
UML Notation for Software Components
“Consumer”
component “Provider” component
accesses («use») provides («realize»)
functionality through functionality through
Required Interface. Provided Interface.
«component» «component»
Consumer Provider
Required Provided
Interface Interface
How to Fit Subsystems Together:
Some Well-Known Architecture Styles
World Wide Web architecture style:REST
(Representational State Transfer)
UNIX shell script architecture style:Pipe-and-Filter
Client/Server
Central Repository (database)
Layered (or Multi-Tiered)
Development platform
Peer-to-Peer (e.g., Web vs. mobile
app, etc.) may dictate
Microservices the architecture style or
vice versa…
Real System is a Combination of
Styles
Central
Subsy
stem Repository
for Architecture
device
control Style Subsyst
em for
remote
data
access
- Valid
keys
Subsyste - Access
m for history
administr - Tenant
ation profiles
- …
Applicat Web
Web
ion browser
server
server
Tiered Architecture
Style
Architecture Styles –Constituent
Parts
1. Components
Processing elements that “do the work”
2. Connectors
Enable communication among components
Broadcast Bus, Middleware-enabled, implicit (events),
explicit (procedure calls, ORBs, explicit communications bus)
…
3. Interfaces
Connection points on components and connectors
define where data may flow in and out of the
components/connectors
4. Configurations
Arrangements of components and connectors that form
an architecture
Connectors: HTTP Protocol
Pipe
Filter
Pipe
Filter
1: 4: 2: 3:
Packing a request Unpacking the response Unpacking the request Packing the response
for network transport for client use for server call for network transport
connector
Web application:
A network of Web resources (a virtual state-machine), where the user by
following the links requests the transfer of next resource (“state”).
REST physical model
(b) HTTP request message carrying the content of the HTML form that
was used to enter the employee data
REST, a resource-based
architecture style
Client/server style that supports caching and replicated repositories
Uniform interface between components based on HTTP methods and URI-named resources,
which is efficient for coarse-grain hypertext/hypermedia data transfer
Server dynamically communicates to clients the application logic in hypertext or in code-on-
demand
Hypertext does not specify the operations allowed on a resource; it just contains embedded
hyperlinks that determine all possible transitions from the current to the next application state
For every media type, the server has defined a default processing model; standard formats for
message payload representation (HTML, XML, JSON, JPEG, …) ensure interoperability
between different clients and servers
Stateless sessions—each request must carry all the information needed for its processing
Statelessness may cause network inefficiency, so requires caching to avoid redundant
responses
A RESTful API looks like hypertext
Every addressable unit of information carries an address or identifier, either explicitly (e.g., link and
id attributes) or implicitly (e.g., derived from the media type definition and representation structure)
Every media type defines a default processing model
Hypertext doesn’t specify the operations allowed on a resource;it specifies which operation to use for
each potential state transition
RESTful API Design versusJSON-RPC
APIs over HTTP
RESTful APIs JSON-RPC APIs over HTTP
URIs for resource
URIs for object addresses
addresses
Focus on navigable Focus on data-processing
resources (nouns) procedures (verbs)
Application logic runs on the
HATEOAS, application client; the server manages the
logic runs on the server data using CRUD and
application-specific RPCs
HTTP methods for
HTTP methods for service
resource CRUD actions,
actions, plus application-specific
plus media-specific
server-side procedures explicitly
server-side controllers
addressed with the verb as part
activated by the media
of the request message URI
type
Message body can be
Example Request
Cannondale Trail 1 12 Kids' Bike:
https://www.rei.com/product/145832/cannondale-trail-1-12-
kids-bike?
CAWELAID=120217890005260197&CAGPSPN=pla&CAAGID=1
5877514320&CATCI=aud-553371945779:pla-
539113402242&cm_mmc=PLA_Google
%7C404_1050512963%7C1458320001%7Cnone%7Ccb2b5bf7-
95ae-43d8-a53c-6a16aaf4a0d0%7Caud-553371945779:pla-
539113402242&lsft=cm_mmc:PLA_Google_LIA
%7C404_1050512963%7C1458320001%7Cnone%7Ccb2b5bf7-
95ae-43d8-a53c-6a16aaf4a0d0&kclid=cb2b5bf7-95ae-43d8-
a53c-
6a16aaf4a0d0&gclid=CjwKCAiAyrXiBRAjEiwATI95mcKyoLfTjKFA
aCiElWKC3Vt51nTPk0Fxyt9rm8S0Y99Dikidu_DQrxoC2CwQAvD_
BwE
Architecture Style:
Model-View-Controller
Model: holds all the data, state and application logic.
Oblivious to the View and Controller. Provides API to
retrieve state and send notifications of state changes to
“observer”
View: gives user a presentation of the Model.Gets data
directly from the Model
Controller: Takes user input and figures out what it
means to the Model
disp
lay View 5. I need your state (to
display)
4. I have Model
changed
3. Change your
1. The user did display
something Contro
us ller 2. Change your
er input
state
Model-View-Controller
User
Interface Model
Controller
Inp Dom
Event Domain
ut ain
Interpret Model
dev mod
er
ice el
eve acti
nts on
Notificati
Visual
Model on
U feedback
Visualizer about
s of the
the
er altered
effects of
model
View the
action
3
2 1 1
Model: array of numbers [ 14, 1 6 3 4
4 ver 1
26, 31 ] 2
sus
6
➔ Different Views for the same
Problem Structure