s7 Flashcards

(30 cards)

1
Q

Define Pipe-and-Filter Architecture.

A

Also called pipeline architecture, it’s a sequential chain of functional components (filters) where the output of one filter becomes the input of the next, connected by “pipes.”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Give an example of Pipe-and-Filter Architecture.

A

UNIX shell commands (e.g., ls folder-name | grep -v match-string | more). Another example is a simple invoice system processing invoices through stages like reading, identifying payments, finding dues, and issuing reminders. Angular Pipes also use this concept.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

List pros of Pipe-and-Filter Architecture.

A

Easy to understand and link to business practices.
Can reuse components (filters).
Easy to extend by adding new components.
Can be sequential or concurrent.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

List cons of Pipe-and-Filter Architecture.

A

Very hard to make interactive.
Potential for performance bottlenecks.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Describe the Model-View-Controller (MVC) architecture.

A

It separates a software system into three components:

Model: Manages data, business rules, and system logic.

View: Presents the model to the user (includes the user interface).

Controller: Accepts user input and passes it to the model. The user sees the View and uses the Controller, which manipulates the Model, and the Model updates the View.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Provide examples of MVC architecture.

A

Web application: Model (database on server), View (HTML on client’s browser), Controller (JavaScript script from server to client). Note: MVC can be imposed on a client-server model.

Video games: Model (game world, player state), View (rendered game world, UI, audio), Controller (listens for user inputs).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

List pros of MVC Architecture.

A

Simultaneous development of components.
High cohesion (related parts grouped together).
Low coupling (components are separate, interact via specific interfaces).
Easy to modify.
Extensibility (e.g., multiple views for the same model).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

List cons of MVC Architecture.

A

Code can become very complex.
Can be difficult to maintain consistency when a feature is split across three components.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Describe Model-View-Presenter (MVP).

A

A variant of MVC where a Presenter acts as an intermediary between the View and the Model (which don’t communicate directly). The View handles user input (unlike in classic MVC), and the Presenter formats model data for the View and interprets inputs from the View. Easier to fit into Client-Server models.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Describe Model-View-View Model (MVVM).

A

A variant where a ViewModel acts as an intermediary. Unlike MVP, the ViewModel doesn’t know about the View. The View directly binds to parts of the ViewModel using a binder. Example: Windows Presentation Foundation (WPF).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What are key differences between MVP and MVVM regarding View and UI Communication?

A

MVP: View is passive, handled by Presenter. UI communication is View <-> Presenter (manual method calls).

MVVM: View is active, binds directly to ViewModel. UI communication is View <-> ViewModel (data binding, observers).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Describe Hierarchical Model-View-Controller (HMVC).

A

A set of MVC triads arranged hierarchically. Higher-level controllers can communicate with lower-level controllers. Allows dynamic control of different parts of a layout without needing to rerender everything. Example: a website with embedded widgets.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Define Event-Driven Architecture (EDA).

A

An architectural style centered on events, where an event is a change of state (hardware or software). Components are either event producers (detect and emit responses to events) or event consumers/processors (receive messages about events and react). Communication is handled by event channels.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Give an example of EDA.

A

A security system where producers are doors/sensors/cameras, and consumers are alarms/security calls/door locks.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What are the two main topologies in EDA?

A

Mediator Topology
Broker Topology

16
Q

Describe the Mediator Topology in EDA.

A

Consists of event producers, an event queue, an event mediator, event channels, and event consumers. Producers trigger events, which go to an event queue. The mediator reads events from the queue and passes them to appropriate event channels, which consumers listen to.

17
Q

Describe the Broker Topology in EDA.

A

Consists of a lightweight event broker that contains all event channels. There is no central mediator to coordinate tasks; producers publish events to channels, and consumers subscribe to these channels.

18
Q

List pros of Event-Driven Architecture.

A

Loose coupling (producers and consumers are independent and can evolve separately).

Components can be replaced seamlessly.

No single point of failure (especially in broker topology).

Less technical load (no server constantly listening for requests in the same way).

Scales well.

19
Q

List cons of Event-Driven Architecture.

A

Can be overly complicated to design and understand.
Difficult to debug due to inconsistent, asynchronous behavior.

20
Q

Describe Microkernel Architecture (Plug-in Architecture).

A

Consists of two types of components:

Core System: Contains the minimum functionality required.
Plug-in Components: Independent, stand-alone components that extend the core system’s functionality. Example: IDEs like VSCode or Eclipse, where the core handles basic functions and plug-ins add features.

21
Q

What is a common use case for Microkernel architecture?

A

It’s frequently used as part of another architecture, for example, replacing one of the layers in a multi-tier architecture. Its simplicity and extensibility make it a good starting point for product-based software.

22
Q

List pros of Microkernel Architecture.

A

Lends itself to agile development.
Easy to deploy plug-ins.
Plug-ins can be tested easily due to their stand-alone nature.
Can lead to better performance (minimal core).

23
Q

List cons of Microkernel Architecture.

A

Difficult to scale if major modifications are needed in the core system (affects every plug-in).
Can be difficult to develop the core system and plug-in management.

24
Define Microservices Architecture.
Divides a system into a number of separately deployed, independent service components. These components are highly specialized, isolated units serving a single function, and are fully decoupled, accessed via remote access protocols (like REST or SOAP). It's a simplified version of Service-Oriented Architecture (SOA).
25
What are the common topologies for Microservices?
API Topology: Services are organized around their exposed APIs, communicating primarily through these APIs (e.g., using HTTP/REST, gRPC). Application Topology: Services are accessed by a traditional client application, tend to be larger, representing portions of a business application. Centralized Topology: Access to services is mediated by a lightweight message broker, allowing greater control and load distribution but introducing a single point of failure.
26
Give an example of Microservices Architecture.
An e-commerce application with separate services for Account, Inventory, and Shipping, often communicating via an API Gateway. Uber's architecture is another example, with services for billing, trip management, notifications, etc.
27
What are key considerations when designing microservices?
Granularity: Avoid services that are too big (tends towards monolithic) or too small (may require too much central control). Data Sharing: Often via shared databases or by functionality exposed through reused code/APIs. Autonomy: Each service can potentially have its own architecture.
28
List pros of Microservices Architecture.
Easy to incorporate into agile methodology. Easy to deploy (each service separately). Easy to test each individual service. Scales very well (individual services scaled as needed). Easy to develop (separate teams on separate services). Robust to failure of individual services.
29
List cons of Microservices Architecture.
Can be difficult to optimize performance due to high reliance on message passing. Not well-suited for small applications. Hard to test the entire system's behavior. Can be costly to set up an entire system of services (infrastructure, orchestration).