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.
Layered architectural pattern
When used
When building new fa ilities on top of existing systems;
when the development is spread accross several teams with each team responsible for a layer of functionality
when there is a requirement for multi-level security
Layeres architecture pattern
Advantages
Allows replacement of entire layers so long as the interface is maintained
Redundant facilities can be provided in each layer to increase the dependability of the system
Layered architecture pattern
Disadvantages
In practice difficult to provide a clean separation btwn layers
High level layer might have to interact directly with lower level rather than thru one between
Performance a prob cause od multiple levels of interpretation of a service requwst as it is processes at each layer.
Repository pattern
Description
All data in system managed in a central repository accessible to all sys components which do not ibterCt directly, only through the repository.
Repository pattern
.
Repository pattern
Advantages
Components can be independent - they do not need to know of the e istence of other components.
Changes made by one component can be propagated to all components.
All data can be managed consistently (backups) as it is all in one place.
Repository pattern
Disadvantages
As a single point of failure any probs can affect the whole system.
May be inefficiencies in organising all communication through the repository.
Distributing the repository across several computers may be difficult.
Client server architecture
Description
Functionality of the system organised into services wirh each service delicered from a separate server. Clients are users of these services and access servers to make use of them.
Client server architecture patern
When used
When data in a shared database has to be accessed from a range of locations. Because servers can be replicated, may also be used when the load on the sys is variable.
Client server architecture pattern
Advantages
Servers can be distributed across a network.
General functionality (printing) can be a available to all clients and does not need to be implemented by all services.
Client server architecture pattern
Disadvantages
Each service is a single point of failure so susceptible to denial of service attacks of server failure.
Performance may be unpredictable as it depends on the network as wekk as the system.
May be management problems if servers are owned by different organisations.
Pipe and filter architecture pattern
Description
Processing of data in system is organised so tjat each processing component (filter) is discrete and carries out one type of data transformation.
The data flows (as in a pipe) from one component to another for processing.
Pipe and filter architecture pattern
When used
In data processing applications where inputs are processed in separate stages to generate related outputs.
Pipe and filter pattern
Advantages
Easy to understand and supports transformation reuse.
Workflow style matches the structure of many business processes.
Evolution by adding transformations is straightforward.
Can be implemented as either sequential or concurrent system.
Pipe and filter architecture pattern
Disadvantages
Format for data transfer has to be agreed upon between communicating transformations.
Each transformation must parse its input and un-parse its output to the agreed form. This increases sys overhead and may mean its impossible to reuse functional transformations that use incompatible data structures.
Architecture validation
Aim
Increase confidence of the design tem that the architecture is fit for purpose.
Has to be achieved within constraints of time and budget.
Be rigorous & efficient as poss.
Architecture validation
Challenges
Design can’t be executed or tested.
May consist of new and COTS components that have to be integrated.
Architecture validation
Techniques
Questioning; how does sys react to various situations; often make use of scenarios.
Construction of a prototype that creates a simple archetype of a desited application.
Measuring; quantitive measures, archit. metrics, simulation etc.
Identify potential flaws Nd improve b4 implementation.
Cheaper to fix before built