Software Architecture Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

Package Cohesion Principles, by Robert C. Martin:

A

REP – The Release Reuse Equivalency Principle
The granule of reuse is the granule of release

CCP – The Common Closure Principle
Classes that change together are packaged together

CRP – The Common Reuse Principle
Classes that are used together are packaged together

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

Package Coupling Principles, by Robert C. Martin:

A

ADP – The Acyclic Dependencies Principle
The dependency graph of packages must have no cycles

SDP – The Stable Dependencies Principle
Depend in the direction of stability

SAP – The Stable Abstractions Principle
Abstractness increases with stability

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

Architectural styles

A

The application design at the highest level of abstraction.

Tell us, in very broad strokes, how to organize our code. It’s the highest level of granularity and it specifies layers, high-level modules of the application and how those modules and layers interact with each other, the relations between them.

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

Architectural Patterns

A

Is a way to implement an Architectural Style.

A pattern is a recurring solution to a recurring problem. In the case of Architectural Patterns, they solve the problems related to the Architectural Style.

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

Design Patterns

A

A way to solve a localised problem.

Differ from Architectural Patterns in their scope, they are more localised, they have less impact on the code base, they impact a specific section of the code base.

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

The modern monolith

A

Having a monolithic Architectural Style simply means that all of the application code is deployed and run as a single process on a single node. We assume, it is using modules and components, although it is in fact often not the case.

Regarding the first one, deployed, it means that it doesn’t matter where the code is physically stored if it is organised in one or several repositories, but how it is organised at runtime. Regarding the second keyword, node, it means that it is still a monolith if we deploy the application to several servers, as in a horizontal scaling context.

In a single node server, all of the modules in a monolith are assembled to the same memory image, which is run as a single process on a single node. Communication is done through standard procedure calls through the same stack and heap. It’s the single memory image makes the application monolithic. If you are running modules in different processes, you’re doing IPC. Because modules fall into different process boundaries, you’ll start facing distributed computing challenges. That’s getting into microservice territory.

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

The modern monolith stops being good enough when we need:

A

Independent scalability of different domain components;

Different components or modules to be written in different programming languages;

Independent deployability, maybe because we have a release rate higher than the deployment pipeline can handle for one code base, causing the deployment of a release to be slow because it needs to wait for the deployment of other releases, or even causing the deployment queue to grow faster than it is consumed.

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

EBI.Entity

A

The Entity objects hold the data used by the system and all the behaviour naturally coupled to this data. Each Entity object represents a concept relevant to the problem domain and wich holds identity and resilient (persistent) data.

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

EBI.Boundary (Interface)

A

The Boundary objects model the interface with the system. Everything concerning the interface of the system is placed in an interface object.

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

EBI.Interactor (Control)

A

Behaviour that remains after the Interface objects and Entity objects have obtained their parts will be placed in the control objects.

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

DDD layers are…

A

User Interface
Responsible for drawing the screens the users use to interact with the application and translating the user’s inputs into application commands.

Application Layer
Orchestrates Domain objects to perform tasks required by the users: the Use Cases. It does not contain business logic. This layer is where the Application Services belong, as they are the containers where the use case orchestration happens.

Domain Layer
This is the layer that contains all the business logic, the Domain Services, Entities, Events and any other object type that contains Business Logic.

Infrastructure
The technical capabilities that support the layers above, ie. persistence or messaging.

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

Bounded context

A

Define a context where an isolated part of the model applies.

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

Anti-Corruption Layer

A

An anti-corruption layer is basically a middleware between two subsystems. It is used to isolate the two subsystems, making them depend on the anti-corruption layer instead of depending directly on each other.

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

Anti-Corruption Layer main concerns are…

A

Adapting subsystems APIs to what the client subsystems need;

Translating data and commands between subsystems;

Establish communication in one or several directions, as needed

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

Shared Kernel

A

In some situations, despite our desire to have completely isolated and decoupled components, it makes sense for some domain code to be shared by multiple components.

This will allow components to stay decoupled from each other, although coupled to that same shared code, the shared kernel.

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

Generic Subdomain

A

A subdomain that is not specific to our application, it could be used in any similar application.

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

Subdomain

A

A very well isolated part of the domain.

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

Adapters Architecture (aka Hexagonal Architecture)

A

Allow an application to equally be driven by users, programs, automated test or batch scripts, and to be developed and tested in isolation from its eventual run-time devices and databases.

Goal: isolate the business logic from the delivery mechanisms and tools used by the system.

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

Adapter

A

A class that transforms (adapts) an interface into another. It depends on a specific tool and a specific port (by implementing an interface).

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

Primary or Driving Adapters

A

The ones to start some action on the application. Both the port and its concrete implementation (the use case) belong inside the application.

21
Q

Secondary or Driven Adapters

A

The ones representing the connections to the backend tools. They always react to an action of a primary adapter. The port belongs inside the application, but its concrete implementation belongs outside

22
Q

Port

A

Consumer agnostic entry and exit point to/from the application. In many languages, it will be an interface.
is designed to fit the business logic needs, so it doesn’t depend on a specific adapter or tool.

23
Q

Layered Architecture consists of …

A

Presentation
Application
Domain
Persistence

24
Q

Key tenets of Onion Architecture:

A

The application is built around an independent object model

Inner layers define interfaces. Outer layers implement interfaces

Direction of coupling is toward the center

All application core code can be compiled and run separate from infrastructure

Any outer layer can directly call any inner layer, which does not break the coupling direction and avoids creating proxy methods and even proxy classes that contain no business logic, just for the sake of complying with some layering scheme

25
Q

Сore objectives behind Clean Architecture (the same as for Ports & Adapters (Hexagonal) and Onion Architectures):

A

Independence of tools
Independence of delivery mechanisms (UI)
Testability in isolation

26
Q

Dependency Inversion Principle at the architectural level

A

Nothing in an inner circle can know anything at all about something in an outer circle. Furthermore, when we pass data across a boundary, it is always in the form that is most convenient for the inner circle.

27
Q

Three cases in which to use events:

A

To decouple components
To perform async tasks
To keep track of state changes (audit log)

28
Q

Martin Fowler identifies three different types of event patterns:

A

Event Notification
Event-Carried State Transfer
Event-Sourcing

29
Q

All event patterns share the same key concepts:

A

Events communicate that something has happened (they occur after something)

Events are broadcasted to any code that is listening (several code units can react to an event)

30
Q

Event Notification

A

The event carries minimal data.

It carries only enough data for the listener to know what happened and carry out their code, usually just entity ID(s) and maybe the date and time that the event was created.

31
Q

Event-Carried State Transfer

A

The event carries the whole new version of the data with it.

32
Q

Event-Sourcing

A

Storing the Entity state changes and computing the Entity state from those changes.

33
Q

Event store

A

Becomes the principal source of truth, and the system state is purely derived from it. For programmers, the best example of this is a version-control system. The log of all the commits is the event store and the working copy of the source tree is the system state.

34
Q

Reversal Transaction

A

Event, in the event stream, that reverses the event that we would like to delete.

35
Q

Projection

A

The computation of the events in an event stream, from and to specific moments. A snapshot, or the current state of an entity, fits the definition of a projection.

But the most valuable idea in the concept of projections, is that we can analyse the “behaviour” of Entities during specific periods of time, which allows us to make educated guesses about the future.

36
Q

Martin Fowler identifies 3 types of code changes:

A

New features
Bug fixes
Temporal logic

37
Q

Advice for using events:

A

Keep events dumb, knowing only about the state change and not how it was decided.

Interactions with external systems should not depend on these events, this way we can safely replay events without the danger of retriggering external logic and we don’t need to ensure the reply from the external system is the same as when the event was played originally.

38
Q

Command Pattern

A

Moves us away from a data-centric application and into a process-centric application, who has domain knowledge and application processes knowledge.

39
Q

Command Bus

A

Capable of receiving a Command and figure out what handler can handle it.

40
Q

Command

A

Simple DTO to hold the data.

41
Q

Handler

A

Have a method to trigger the logic execution.

42
Q

SOA focuses on only a few concepts and doesn’t give any prescription on how to implement them:

A

Composability of user-facing applications;
Reusable Business Services;
Technology stack independent;
Autonomy (independent evolution, scalability & deployability).

43
Q

CORBA (Common Object Request Broker Architecture)

A

The CORBA standard was implemented by several vendors and aimed at providing:

Platform neutral Remote Procedure Call;
Transactions (also remote transactions!!);
Security;
Events;
Programming language independence;
OS independence;
Hardware independence;
Isolation from data-transfer/communication details;
Data typing through an Interface Definition Language (IDL).

44
Q

Web Services

A

Are designed as bounded contexts for business sub-domains, abstracting the implementation from the conceptual service they provide.

45
Q

The primary duties of an ESB (Enterprise Service Bus) are:

A

Monitor and control routing of message exchange between services;
Resolve translation of messages between communicating service components;
Control deployment and versioning of services;
Marshal use of redundant services;
Cater for commodity services like event handling, data transformation and mapping, message and event queuing and sequencing, security or exception handling, protocol conversion and enforcing proper quality of communication service;

It was born into a context of stand-alone applications that needed to be integrated in order to achieve an enterprise-wide distributed application.

46
Q

Microservices Architecture main idea is…

A

Creating one global enterprise application from several more specific business domain applications. It was born into a context of fast paced and ever changing businesses who (mostly) create their own cloud applications from scratch.

Small autonomous services that work together, modeled around a business domain.

47
Q

Sam Newman, the author of Building Microservices, identifies 8 principles of a Microservices Architecture:

A
Services are modeled around business domains
Culture of automation
Hide implementation details
Decentralise all the things
Deploy independently
Consumer first
Isolate failure
Highly observable
48
Q

Inversion of control principle

A

The direction of dependencies is towards the center.

49
Q

The basic principles that form the bedrock of good software are…

A

Simplicity, which keeps programs short and manageable;

Clarity, which makes sure they are easy to understand, for people as well as machines;

Generality, which means they work well in a broad range of situations and adapt well as new situations arise;

Automation, which lets the machine do the work for us, freeing us from mundane tasks.