Architectural Patterns and Styles Flashcards
7 cards from real CPSA practice questions. Tap to flip, then mark Knew It or Still Learning โ missed cards come back until you master them.
Read the first 7 Architectural Patterns and Styles flashcards as text
In Hexagonal Architecture (Ports and Adapters), what is the primary role of a 'port'?
Answer: An interface defining how the application interacts with the outside world
A port is an interface (API or SPI) that defines how the core domain communicates with external actors, keeping the domain independent of specific technologies.
Which architectural pattern separates the responsibility of reading data from writing data into distinct models?
Answer: CQRS (Command Query Responsibility Segregation)
CQRS splits the application into a Command side (writes/mutations) and a Query side (reads), allowing each to be optimized independently.
Event Sourcing stores application state as a sequence of events. What is the main advantage of this approach?
Answer: A complete audit trail and the ability to reconstruct past states
Because every state change is recorded as an immutable event, you can replay the event log to reconstruct the system state at any point in time.
In the Strangler Fig pattern, what happens to the legacy system over time?
Answer: New functionality wraps and gradually replaces the old system until the legacy is removed
Like a strangler fig vine, new services incrementally take over functionality from the legacy system until the old system can be decommissioned.
Which of the following best describes the Pipe-and-Filter architectural style?
Answer: Processing steps (filters) are connected by data channels (pipes) enabling sequential transformation
In Pipe-and-Filter, independent filter components process data and pass results through pipes, enabling composable, reusable processing chains.
A system uses the Blackboard architectural pattern. Which scenario best fits this style?
Answer: Multiple specialized subsystems collaborate to incrementally solve a complex problem like speech recognition
The Blackboard pattern suits problems where multiple knowledge sources (specialists) contribute partial solutions to a shared data store until a complete solution emerges.
In Service-Oriented Architecture (SOA), what is the purpose of an Enterprise Service Bus (ESB)?
Answer: To mediate, transform, and route messages between loosely coupled services
An ESB acts as middleware that handles routing, protocol transformation, message translation, and orchestration between services in an SOA.