- Published on
COMP2120 Week 4 - Architecture
Table of Contents
Twin Peaks View
- As more is known about a project, the higher the peaks grow. They progressively develop more detailed requirements and architectural specifications concurrently.
What is Architecture?
-
Essentially the same as 'design'
-
Architectural design -> Designing the overall structure of the system
- Big picture
- Identifies main structural components and the relationships between them
Design Decisions
-
A creative process, where design outcomes differ depending on the type of system being developed
-
Common decisions:
- Is there a generic application or pattern that can act as a template?
- How will the system be distributed or run?
- How will components be split into sub-components?
- What architecture satisfies the non-functional requirements?
Examples
-
Performance -> Localised critical operations and minimised communications. Not very distributed
- Sommerville Chapter 17
-
Security -> Layered architecture with critical assets at innermost layers
- Sommerville Chapter 13
-
Safety -> Localised safety-critical features all in one component.
- Sommerville Chapter 12
-
Availability -> Redundant components and mechanisms for fault tolerance
- Sommerville Chapter 11
-
Maintainability -> Fine-grain, replaceable components.
Note: Performance needs large components, but maintainability needs small components
Architectural Patterns
- Tried and tested stylized description of good design practice
- Should include information about when they are (and aren't) useful
Layered Architecture
- Best "logical" architecture
- If in doubt, start here
- Set of layers which provide services and can support incremental development of different layers independently of other layers
- Rules can be defined
- Typically "higher" layers depend on "lower" layers
- Strict layering -> A layer only depends on the layer immediately below it
| Name | Description |
|---|---|
| Description | Organised into layers with related functionality. Layers provide services to level above it sothe lowest-level layers represent core services |
| When is it used | Good generic architecture. Good where development is spread across several teams + requirement for multi-level security |
| Advantages | Whole layers can be replaced as long as the interface is maintained. Redundant facilities can be provided in each layer to increase dependability |
| Disadvantages | Clean separation of layers is difficult. Performance can be a problem due to multi-level inerpretations of a service request (processing at each layer) |
Model-View-Controller (MVC) Architecture
| Name | Description |
|---|---|
| Description | Separates presentation and interaction from system data. Three logical components. Thew Model component manages system data and operations on data. The View component defines and manages how the data is presented. The Controller component manages user interaction and passes them to both the View and Model |
| When is it used | Best used when multiple possible ways to view and interact with data are possible. |
| Advantages | Allows data to change independently of its representation and vice versa. Presentation of the same type of data in different ways with changes made in one shown in all of them |
| Disadvantages | Additional code and code complexity required. Application can turn complex and become a mess |
Repository Architecture
| Name | Description |
|---|---|
| Description | All data managed in a central repository accessible to all system components. Do not interact directly, only via repository |
| When is it used | Use if large volumes of information is generated that must be stored for a long time. Can also be used in data-driven systems |
| Advantages | Components can be independent. Changes made by one componenet can be propagated to all components. All data can be managed consistently |
| Disadvantages | Repository is a single point of failure. Inefficiencies in organising communication through repository may exist. Discribution of repository across multiple devices is difficult |
Client-server Architecture
-
Distributed system model
-
Can be stand-alone servers which provide specific services, with a set of clients who use those services
| Name | Description |
|---|---|
| Description | Functionality organised into services, delivered from a seperate server. |
| When is it used | Best suited for use in a shared database where it will be accessed from a range of locations. Server replication allows for upscaling of services based on a variable load. Anticipates microservices |
| Advantages | Principle advantage is distributed servers across a network where it doesn't need to be implemented by all individual services |
| Disadvantages | Each service is a single point of failure. Performance depends on the network as well as the system |
Pipe and Filter Architecture
-
Functional transformations process inputs to become outputs
-
Useful when transformations are sequential (batch sequential model) and is extensively used in data processing systems
-
Not realy suitable for interactive systems
| Name | Description |
|---|---|
| Description | Processing is organised so that each processing component is discrete and carries out one type of data transformation. Data flows (like a pipe) from one componenet to another |
| When is it used | Data processing applications where inputs are processed in separate stages to generate related outputs |
| Advantages | Easy to understand and supports transformation reuse. Can be implemented as either a sequential or concurrent system |
| Disadvantages | Format for data transfer needs to be pre-agreed on. Transformations need to parse its input and unparse output to agreed form, increasing overhead |