Architecture patterns Flashcards
aims of software patterns
enhance reusability of OO code
benefits of design patterns
capture expertise and make it accessible to non-experts in an encapsulated design pattern help communication amongst devs makes usuability easier facilitate design modifications improve design documentation
architectural model
artefact documenting some or all of the architectural design decisions about a system
architecture visualization
depicts some or all of design decisions to a stakeholder
architecture view
subset of related architectural design decisions
when is MVC pattern used
when there are multiple ways to view and interact with the data
when the future requirements for interaction and presentation of data are unknown
how does MVC work
separates presentation and interaction of data
Model - manages systems data ans associated operations on that data
view - manages how the data appears to the user
controller manages the user interaction and passes these interaction to the view and the model
pros of mvc
allows data to change independently of its representation
supports presentation of the same data in different ways with changes made in one representation shown in all of them
cons of mvc
can involve additional code and code complexity
when is layered architecture pattern used
when building new facilities on top of existing systems
development spread across several teams
how does layered architecture work
organizes system into layers with related functionality associated with each layer
pros of layered arch
servers can be distributed across a network and servers can be added/removed with minimal disruption
cons of layered arch
each service is a single point of failure - server failure
performance can be unpredictable because it depends on the network and the system
server management issues
when is pipe and filter pattern used
data processing applications where inputs are processed in separate stages to generate related outputs
how does pipe and filter pattern work
processing of the data in a system is organized so that each processing component (filter) carries out one type of data transformation. Data flows via pipe into component for processing
pros of pipe and filter pattern
easy to understand and supports transformation reuse
matches structure of many business processes
evolution by adding filters/transformation
implemented sequentially or concurrent
cons of pipe and filter pattern
format for data transfer has to be agreed upon between communicating transformations
input parsing and unparsing - overhead, difficult to reuse things
key aim of design patterns
minimize coupling (degree to which communication takes place between modules) and increase cohesion (degree to which communication takes place within module)
problems because of a design with high coupling
changes in related classes force local changes
harder to understand inisolation
harer to reuse
Examples of non-functional requirements
performance security safety availability maintainability
when to use repository pattern
when you have system in which large volume of information is generated that has to be stored for a long time
data-driven systems where the inclusion of data in the repository triggers an action or tool
how does the repository pattern work
all data in a system is managed in a central repository that is accessible to all system components
components only interact through
pros of repository system
components can be independent
all data managed consistantly
cons of repos system
single point of failure - one issue can affect the whole system
efficiencies in organzainisng all communications through the repo
distributing repo across various computers may be difficult