Software Architecture
Summary
- What is Software Architecture?
- Prescriptive v Descriptive Architecture
- Architectural Evolution
- Architectural Elements
- Architectural Styles
- Takeaways
What is Software Architecture?
Elements, Form, and Rationale
- What, how, and why
- Perry and Wolf
Shaw and Garland say that Software Architecture
is a level of design that involves
- description of elements from which systems are built
- interactions among those elements
- patterns that guide their composition
- constraints on those patterns
Software Architecture := a set of principal design decisions about the system
Blueprint
- Structure
- Behavior
- Interaction
- Non-functional Properties
Temporal aspect
- SWA is not defined at once, but iteratively, overtime
Prescriptive v Descriptive Architecture
A prescriptive architecture captures the design decisions made prior to the system’s construction.
- “as-conceived” SWA
A descriptive architecture describes how the system has actually been built
- “as-implemented” SWA
Architectural Evolution
Ideally, when a system evolves, the prescriptive SWA should be modified first. This rarely happens.
Can happen for multiple reasons:
- Dev Sloppiness
- Short deadlines
- Lack of documented prescriptive SWA
- …
Architecture Degradation
Architectural Drift := introduction of architectural design decisions orthogonal to a system’s prescriptive architecture
Architectural Erosion := introduction of architectural design decisions that violate a system’s prescriptive architecture
Architectural Recovery
Drift and Erosion degraded architecture
- Keep tweaking code
- Fix it
Architectural Recovery := determining the SWA from implementation and fixing it.
Architectural Elements
3 main types of elements:
- Processing
- Implement business logic
- Perform transformations on data
- Data
- Contain information to be used
- Interaction
- Glue that holds everything together
Processing + Data = Components
Interaction elements are contained and controlled by system connectors
Components + Connectors = Configuration
Components, Connectors, and Configurations
Software Component := an architectural entity that encapsulates a subset of the system’s functionality and/or data
Components restrict access to that subset via explicit interface
Software Connector := an architectural entity effecting and regulating interactions
Architectural configuration := association between components and connectors of a software architecture
Architectural Styles
Styles capture idioms that work well together
A family of systems in terms of a pattern of structural organization; a vocabulary of components and connectors, with constraints on how they can be combined.
Named collection of architectural design decisions applicable in a given context
Type of Styles
- Pipes and Filters
- Chain of processing elements
- Output of one element is input of next element
- Event-driven
- Event-Emitters and Event-Consumers
- Like GUI’s reacting to push of a button
- PubSub
- Senders send messages with tags, and without knowledge of who will receive them
- Receivers listen for messages with certain tags
- Client-Server
- Server provides functionality
- Client requests functionality
- P2P
- Decentralized
- Nodes act as providers and requesters of functionality
- REST
- Respresentational State Transfer
- Hybrid architecture for distributed hypermedia systems
- Uniform Connector Interface
P2P Styles
Decentralized resource sharing and discovery
Napster
P2P File sharing system
- Peer A registers with content directory
- Peer B registers with content directory
- Peer A requests a song
- Content directory returns a handle to peer that contains requested song
- Peer A requests song
- Peer B responds with song
Content Directory is SPOF and issue with scaling
Skype
Login server is only SPOF
Supernodes are NOT owned by skype. They are just regular nodes that are promoted by skype
- Requires node to be up for a long time
- Microsoft killed Skype for 36 hours because they pushed a critical Windows Update that force-rebooted a bunch of machines
Peer 2 can talk to Peer 3 by going through Super Nodes A and B
Takeaways
A great architecture
- is a ticket to success
- reflects a deep understanding of the problem domain
- normally combines aspects of several simpler architectures