COMP2007-Architectural patterns Flashcards
Model View Controller
Problem:
separation of UI from application
Context:
interactive applications with a flexible UI
Solution:
system model: UI (View and Controller component) decoupled from the application (Model component)
- components: collections of procedures (module)
- connectors: procedure calls
- control structure: single thread
Definition
Describes a family of architectures in terms of their structural organisation.
Means of representing, sharing and reusing knowledge.
When uselful and when not
Can be represented using tabular and graphical descriptions.
MVC - Model-View-Controller
Separates
presentation and
interaction from
system data.
The model component
Manages system data and associated operations on that data.
The view component
Defines and manages how the data is presented to the user.
The controller component
manages user interaction and passes these to the view and the model.
Mvc is used
When there are multiple ways to view and interact with the data
Also when future requirements for interaction and presentation of data are unknown.
Advantages of MVC
Allows data to change independently of its representation and vice versa
Supports presentation of the same data in different ways with changes made in one representation shown in all of them.
Disadvantages of MVC
Can involve additional code and code complexity when the data model and interactions are simple.
Layered pattern
Problem
- distinct, hierarchical classes of services
Concentric circles of functionality
Layered pattern context
A large system that requires decomposition (eg virtul machines, OSI model)
Layered pattern solution
- system model:
hierarchy of layers, often limited visibility - components:
collections of procedures (module) - control structure: single or multiple threads
Layered architecture
Used to model the interfacing of sub-systems
Organises the system into a set of layers (or abstract machines) each of which provide a set od services
…
Layered architecture cont…
Supports incremental development of sub-systems in different layers
When a layer interface changes, only the adjacent layer is affected.
It is however, often artifici to structure systems in this way.
Layered architecture pattern
Description
Organises the system into layers with related funtionality associated with each layer
A layer provides services to the layer above it so the lowest-lecel layers represent core services that are likely to be used throughout the system.