Onion Architecture Flashcards

1
Q

What are the key principles?

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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the layers of this architecture?

A

Infrastrucure -> aplication services -> domain services -> domain model

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

What is the advantage of this architecture in relation to the traditional layered approach?

A

In the traditional approach every layer can depend on the infrastructure, leading to problems when changing the delivery mechanism and external tools. On the other hand, in Onion, the application core is completely independent of the infrastructure.

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

What is the difference between application service and domain service?

A

Domain services contain domain logic that can’t naturally be placed in an entity or value object whereas application services orchestrate the execution of domain logic and don’t themselves implement any domain logic.

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

What is the Onion Architecture?

A

It is a software architecture that provides a better way to build applications in perspective of better testability, maintainability, and dependability. It is composed of concentric layers. Onion Architecture consists 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