Design and Architectural Patterns Flashcards

1
Q

Architectural design working definition

A

high-level structural decisions about a system.

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

Architectural styles

A

High-level abstractions guiding the overall organisation of a system.
e.g. client/server, pipes and filters, microservices

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

Architectural patterns

A

detailed solution to recurring architectural problems within a specific style

e.g. model view controller (MVC), onion architecture

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

Design patterns

A

Specific solutions to recurring design problems at a lower level than architectural patterns, e.g. adapter, bridge, strategy, composite

Patterns are ways to describe best practices, good design, and capture experience
in a way that is possible for others to reuse this experience.

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

Layered architecture description

A

Architectural style.
Organises the system into layers with related functionality
associated with each layer. For example, a presentation layer would be responsible for handling all user interface and browser communication logic. The presentation layer doesn’t need to know or worry about how to get customer data; it only needs to display that information on a screen in particular format.

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

Advantages of layered architecture

A

Allows replacement of entire layers so long as the interface is maintained.
Redundant facilities (e.g. authentication) can be provided in each layer to increase the dependability of the system.

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

Disadvantages of layered architecture

A

Providing a clean separation between layers is often difficult and a high-level layer may have to interact directly with lower-level layers rather than through the layer immediately below it.
Performance can be a problem because need to be processed at each layer.

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

Pipes and filters architecture description

A

Architectural pattern.
Processing of the data in a system is organised so that each processing component (filter) is discrete and carries out one type of data transformation. The data flows (as in a pipe) from one component to another for processing.

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

Pipes and filters architecture advantages

A

Easy to understand and supports transformation reuse.
Workflow style matches the structure of many business processes.
Evolution by adding transformations is straightforward.
Can be implemented as either a sequential or concurrent system.

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

Pipes and filters architecture disadvantages

A

The format for data transfer has to be agreed upon between communication transformations.
Each transformation must parse its input and unparse its output to agreed form –> increases system overhead and may mean that it is impossible to reuse functional transformations that use incompatible data structures.

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

Model-view-controller (MVC) description

A

Separates presentation and interaction from the system data.

Structured into three logical components that interact with each other.

Model: manages the system data and associated operations on that data.
View: defines and manages how the data is presented to the user.
Controller: manages user interaction (e.g. key presses, mouse clicks, etc.) and passes these interactions to the View and the Model.

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

Model-view-controller when used

A

Used when there are multiple ways to view and interact with data.

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

Model-view-controller advantages

A

Allows the data to change independently of its representation and vice versa.

Supports presentation of the same data in different ways with changes made in one representation shown in all of them.

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

Model-view-controller disadvantages

A

Can involve additional code and code complexity when the data model and interactions are simple.

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

The design patterns can be categorised into three, what are they? and explain them

A

Structural patterns:
Simplify the composition of classes and objects to form larger structures.

Behavioural patterns:
Address communication between objects by defining how objects interact and distribute responsibilities.

Creational patterns:
Deal with the process of object creation, providing flexibility and reusability in creating objects.

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

Design pattern: adapter

A

Adapt the interface of an already existing class to the interface that a client is accepting.