Architectural Styles Flashcards
1
Q
ARCHITECTURAL STYLES
A
- An architectural style is a named collection of architectural design decisions that -are applicable in a given development context -elicit beneficial qualities in each resulting system
- A primary way of characterizing lessons from experience in software system design
- Reflect less domain specificity than architectural patterns
- Useful in determining everything from subroutine structure to top-level application structure
2
Q
PARTS OF A STYLE
A
- A set of component types with a given role/functionality
- A topology of relations (usually runtime relations)
- A set of connector types that handle communication, coordination, or collaboration
- A set of semantic constraints -I.e., what may components/connectors do or not do?
3
Q
Traditional, language-influenced styles
A
- Main program and subroutines
- Object-oriented
4
Q
Layered styles
A
- Virtual machines
- Client-server
5
Q
Data-flow styles
A
- Batch sequential
- Pipes and filters
6
Q
Shared memory styles
A
- Blackboard
- Rule based
7
Q
Interpreter Styles
A
- Interpreter
- Mobile code
8
Q
Implicit invocation Styles
A
- Event-based
- Publish-subscribe
9
Q
Styles classification
A
- Communication: Service-oriented architecture (SOA), Message Bus
- Deployment: Client/Server, N-tier, 3-tier
- Domain: Domain Driven Design
- Structure: Componend-Based, Object-Oriented, Layered-Architecture
10
Q
Blackboard Style
A
- Useful for problems for which no deterministic solution strategies are known
- several specialized subsystems assemble their knowledge to build a possibly partial or approximate solution
- Example: speech recognition, submarine detection, inference of 3D molecule structure
- All components have access to a shared data store (the blackboard)
- Components produce new data objects that are added to the blackboard
- Components look for particular kinds of data on the blackboard
- Find these by pattern matching
11
Q
Blackboard Style (2)
A
- Processes have to agree on the structure of the shared data space
- Adding new applications is easy
- Extending the structure of the data space is easy
- Modifying the structure of the data space is hard
- Possible need for synchronization, access control
12
Q
Pipes and Filters
A
Components (Filters)
- read streams of data on input producing streams of data on output
- local incremental transformation to input stream
- output usually begins before input is consumed
Connectors (Pipes)
- conduits for streams e.g. first-in-first-out buffer
- transmit outputs from one filter to input of other
Invariants
- filters must be independent, no shared state
- filters don’t know upstream or downstream filter identity
- correctness of output from network must not depend on order in which individual filters provide their incremental processing
Common specialisations
- pipelines: linear sequence of filters
- bounded and typed pipes …
- Common Example: lex/yacc -based compiler (scan, parse, generate code, ..)
13
Q
Pipes and Filters Strengths
A
- Overall behaviour is a simple composition of behaviour of individual filters.
- Reuse - any two filters can be connected if they agree on that data format that is transmitted.
- Ease of maintenance - filters can be added or replaced.
- Prototyping e.g. Unix shell scripts are famously powerful and flexible.
- Architecture supports formal analysis - throughput and deadlock detection
- Potential for parallelism - filters implemented as separate tasks, consuming and producing data incrementally.
14
Q
PIPES AND FILTERS WEAKNESSES
A
- Can degenerate to ‘batch processing’ - filter processes all of its data before passing on (rather than incrementally)
- Sharing global data is expensive or limiting
- Can be difficult to design incremental filters
- Not appropriate for interactive applications
- Synchronization of streams will constrain architecture.
- Error handling e.g. filter has consumed three quarters of its input and produced half its output and some intermediate filter crashes!
- Implementation may force lowest common denominator on data transmission e.g. Unix scripts everything is ASCII.
15
Q
Object-Oriented Style
A
- Components are objects
- Data and associated operations
- Connectors are messages and method invocations
- Style invariants
- Objects are responsible for their internal representation integrity
- Internal representation is hidden from other objects
- Advantages
- “Infinite malleability” of object internals
- System decomposition into sets of interacting agents
- Disadvantages
- Objects must know identities of servers
- Side effects in object method invocations