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.
Twin peaks

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
NameDescription
DescriptionOrganised into layers with related functionality. Layers provide services to level above it sothe lowest-level layers represent core services
When is it usedGood generic architecture. Good where development is spread across several teams + requirement for multi-level security
AdvantagesWhole layers can be replaced as long as the interface is maintained. Redundant facilities can be provided in each layer to increase dependability
DisadvantagesClean separation of layers is difficult. Performance can be a problem due to multi-level inerpretations of a service request (processing at each layer)
Three layered architecture

Model-View-Controller (MVC) Architecture

NameDescription
DescriptionSeparates 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 usedBest used when multiple possible ways to view and interact with data are possible.
AdvantagesAllows 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
DisadvantagesAdditional code and code complexity required. Application can turn complex and become a mess

Repository Architecture

NameDescription
DescriptionAll data managed in a central repository accessible to all system components. Do not interact directly, only via repository
When is it usedUse if large volumes of information is generated that must be stored for a long time. Can also be used in data-driven systems
AdvantagesComponents can be independent. Changes made by one componenet can be propagated to all components. All data can be managed consistently
DisadvantagesRepository is a single point of failure. Inefficiencies in organising communication through repository may exist. Discribution of repository across multiple devices is difficult
Repository architecture

Client-server Architecture

  • Distributed system model

  • Can be stand-alone servers which provide specific services, with a set of clients who use those services

NameDescription
DescriptionFunctionality organised into services, delivered from a seperate server.
When is it usedBest 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
AdvantagesPrinciple advantage is distributed servers across a network where it doesn't need to be implemented by all individual services
DisadvantagesEach service is a single point of failure. Performance depends on the network as well as the system
Client-server

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

NameDescription
DescriptionProcessing 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 usedData processing applications where inputs are processed in separate stages to generate related outputs
AdvantagesEasy to understand and supports transformation reuse. Can be implemented as either a sequential or concurrent system
DisadvantagesFormat for data transfer needs to be pre-agreed on. Transformations need to parse its input and unparse output to agreed form, increasing overhead