Chapter 9 Flashcards
Architectural Patterns vs. Design Patterns
Architectural patterns focus on the concept while Design patterns focus on the implementation
5 Architectural Patterns
- Model-View-Controller
- Layered
- Repository
- Client-Server
- Pipe and Filter
MVC Uses
Used when the are multiple ways to view and interact with data, or when future requirements for interaction and presentation are unknown.
Pro of MVC
Allows data to change independently of its representation and vice versa. Changes in one view shown in all of them
Con of MVC
Additional code and code complexity
Pros of Layered Pattern
Allows replacement of an entire layer as long as the interfaces maintain
Increased dependability possible since redundant facilities can be provided in each layer
Cons of Layered Pattern
In practice, clean separation of layers is difficult
Direction communication across layers not immediately adjacent might be required
Performance overhead due to multiple levels of interpretation of a service request
Use for Repository Pattern
Used when large volumes of data are generated and have to be stored for a long time. Also used in data-driven systems where the inclusion of data in the repository/database triggers an action, event, or tool
Uses of Layered Pattern
Used when development is spread across several teams with each responsible for a layer of functionality
When a multi-level security is required.
Pros of Repository Pattern
Components can be independent and do not need to know of the existence of other components
Changes made by one component to the data can be propagated to all components
All data can be managed consistently as it is all centralized in one place.
Cons of Repository Pattern
The repository is a single point of failure, and distributing the repository/database across several nodes may be difficult
Inefficiencies in the components’ communications
Components must operate around an agreed repository/database data model
Purpose of Client-Server Pattern
Shows the dynamic view of distributed systems. It organizes a system as a set of services and associated servers and clients
Pros of Client-Server Pattern
Servers can be distributed across a network, and general functionality can be available to all clients without the need for implementation by all servers providing the services.
Servers can be upgraded transparently
Many distributed processors may be utilized efficiently
Cons of Client-Server Pattern
Each service is a single point of failure susceptible to denial-of-service attacks or server failures
Unpredictable performance depending on the network conditions and various nodes
Management problems if servers owned by different organizations
Origin of Pipe and Filter Pattern
Pipes comes from UNIX pipes
Filter means the transformation filters out the data it can process from the input stream