Architectural Patterns Flashcards
What types of Architectural patterns (systems) are differentiated?
- Adaptable systems
- Interactive systems
- From Chaos to Structure systems
- Distributed Systems
Name Adaptable systems:
- Dependency Injection
Describe Dependency injection from the perspective of adaptable systems
- pattern provides an independent building block for the purpose of managing lifecycles of instances and deciding which specific classes are instantiated at runtime: assembler
- can be regarded as ‘universal factory’
- via meta-information specific implementations of abstract services are generated or determined
Name interactive systems architecture patterns
- Model-View-Controller Pattern (MVC)
- Model-View-Presenter Pattern (MVP)
- Presentation-abstraction-control (PAC)
Name Patterns to create structure from chaos
- Blackboard Pattern
- Layered-Architecture Pattern
- Pipes and Filters Pattern
Describe the Layered Architecture Pattern
- layers of the same level of abstraction, encapsulate operations
- closed layers, so that effects of subsequent changes only affect that layer
- information exchange via interfaces, called services
- higher layer uses services provided by below layer
- communication across multiple layers is usually not permitted
What can be drawbacks of a layered architecture?
- if requests are just passed through layers without additional logic a lot of unnecessary overhead is created
- adding a data field has a vertical effect, affecting all layers
Describe the Pipes and Filters Pattern
- Filters transform data passed to them, processing units
- pipes work as conncetion between filters, data channels
- filters don’t know about other filters
- free sequencing of multiple filters and pipes independent of each other -> higher reusability
What aspects are decoupled in a Pipes and Filters Pattern?
- chronologically (direct or time-shifted)
- transport mechanism / format
- dynamic determination of next filter: parallelism, load sharing, optional filters
What can be drawbacks of the Pipes and Filters pattern?
- error states during can be complicated to deal with
What are the Blackboard Pattern elements?
Three elements:
- blackboard
- KnowledgeSolution(s)
- Controller
In the Blackboard Pattern, what is the Blackboard responsible for?
- manages the solutions approaches or solution elements of the Knowledge Sources
In the Blackboard Pattern what are the KnowledgeSources?
- one or more independent KnowledgeSources
- analyze problems from a particular point of view and send solution proposals to Blackboard
In the Blackboard Pattern what is the Controller?
- controler components
- monitors the Blackboard
- where necessary controls the execution of KnowledgeSources
Describe the Blackboard Pattern
- complex problem with many facets gets analysed via multiple KnowledgeSources
- Blackboard is used to find best possible solution or solution-mix
- by KnowledgeSources proposed solutions can be approximate or incomplete
What are examples for the Blackboard Pattern?
- image processing
- image recognition
- voice recognition
- system monitoring
Describe challenges of distributed systems
- split-brain problem
- disrupted network connection can lead to inconsistencies
- failure handling needs to be explicitly addressed
- latendy is not stable
- exact temporal sequence of events is impossible to reconstruct
What is the Split Brain problem in Distributed Systems?
- because of a network failure inconsistencies and problems may arise, what the true state of the system should be
What Patterns are used in Distributed Systems?
- Broker pattern
- Service-Oriented Architecture
- modularization
- microservices
Describe the Broker pattern
- only availability of another service is relevant for a system, not physical locality
- broker works as switching center for all other services, central point of communication
- services need to register with the broker
- requests are directed to broker, redirected by him to the target system
- responses flow again through the broker
Describe the Service-Oriented Architecture Pattern
- services consume interfaces of each other after searching for target services in the service directory
- these interfaces are functional and have low-granularity
- interfaces are also contractual
- services should be idempotent, stateless, transactional, self-contained
What are important roles in the Service Oriented Architecture Pattern?
Service Directory/directory service:
- publishes services registered by service providers
Service providers:
- offers services and registers them with directory service
Service Consumer:
- searches for services in service directory
- after finding them there calls their interfaces directly
- establishes a link with service provider
How are Architecture Pattern and Design Patterns different?
- line is blurred
- Architectural patterns usually help in decomposition and composition of components
- Design patterns are more often used to support the implementation of functionality
What is important about services in SOA?
each service:
- has a defined scope
- can be accessed from other components or services
- works as a module capable of delivering the input/output requested