Onion Architecture Flashcards

1
Q

What is the Onion Architecture in software engineering

A

Onion Architecture is comprised of multiple concentric layers interfacing each other towards the core that represents the domain.

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

What does the achitecture depend on?

A

The architecture does not depend on the data layer as in classic multi-tier architectures, but on the actual domain models

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

Which SOLID principle does it depend on?

A

Onion Architecture is based on the inversion of control principle

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

What problem does it resolve?

A

Seperation of concerns.

As per traditional architecture, the UI layer interacts to business logic, and business logic talks to the data layer, and all the layers are mixed up and depend heavily on each other. In 3-tier and n-tier architectures.

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

How does it solve it?

A

Loose coupling

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

What are the layers?

A
  • Domain
  • Application
  • Infrastructure
  • User Interface
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the Domain Layer?

A

Center of the architecture representing business and behaviour objects

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

What is the Application Layer?

A

Orchestrates the domain objects

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

What is the Infrastructure Layer?

A

External concerns such as data access and logging

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

What is the User Interface Layer?

A

Presenting information to user and handling user input

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

Gives an example of the kind of things in the Domain Layer?

A
  • Entities
  • Domain Services
  • Repository Interfaces

ie DB entities

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

Gives an example of the kind of things in the Application Layer?

A
  • Validating User Input
  • Managing Transactions
  • Coordinating multile domain objects to implement a business process

ie User, UserService

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

Gives an example of the kind of things in the Infrastructure Layer?

A
  • Data Persistence
  • Caching
  • Messaging

ie Repository, Unit Of Work, Email

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

Gives an example of the kind of things in the User Interface Layer?

A
  • Screens
  • Forms
  • Controls

ie UserAdmin, UserAdd, UserItem

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

Is Onion Architecture the same as Clean Architecture?

A

They are similar but not the same.

See future cards on Clean Architecture

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