Domain Driven Design Flashcards

1
Q

Describe domain-driven design

A

Domain-Driven Design or DDD is an approach to software development that centers the development on programming a domain model that has a rich understanding of the processes and rules of a domain. The name comes from a 2003 book by Eric Evans that describes the approach through a catalog of patterns.

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

What are the three core principles of domain-driven design?

A
  • Focus on the core domain: Before you begin coding, talk to people who work in that domain. They can help you to define all of the processes, procedures, and terminology of that domain. For example, if you are designing software to manage retail inventory, talk to the people who manage the store inventory rather than employees in HR or finance.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Describe the key domain-driven design term: Domain logic

A

Domain logic: Also called business logic. This is the purpose of your model and software design. The design is based on the logic of real-world business rules that are translated to programming code.

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

Describe the key domain-driven design term: Design patterns

A

Design patterns: If there is existing code that solves a problem similar to one you’re working on, adapt it for your use. Don’t try to reinvent the wheel every time.

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

Describe the key domain-driven design term: Context

A

Context: The setting or environment that determines the meaning of a word, action, or feature within the software domain. For example, in a certain context it may make more sense to use an “Apply” button instead of a “Save” button.

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

Describe the key domain-driven design term: Bounded context

A

Bounded context: Large projects usually have many models that need to be integrated. A context boundary defines the logical frame in which a model can evolve. This helps other teams understand what they have to do to make their models valid when they are added to others.

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

Describe the key domain-driven design term: Context mapping

A

Context mapping: A document, graph, or diagram that outlines the relationships among multiple bounded contexts. The map shows each context’s language, independent implementation, and the interface used to communicate with other bounded contexts.

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

Describe the key domain-driven design term: Entities

A

Entities: An entity is a domain object that is defined by its unique identifier rather than by attributes. For example, a person buys a ticket to see a movie. The person is an entity because the unique identifier defines who that person is regardless of changes to hair color, weight, height, and so on.

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

Describe the key domain-driven design term: Value objects

A

Value objects: An unchangeable object that has attributes, but no distinct identity. For example, you buy a movie ticket that does not include assigned seating. All seats in the theater are the same. The seats are bolted down and can’t be moved, but your ticket lets you select any available seat. In this context, the seat is a value object.

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

Understanding domain-driven design

A

According to DDD, we should not construct a unique Domain Model that keeps all the views as separate models. Instead, the whole application domain is split into smaller domains, each with a separate model. These separate domains are called Bounded Contexts. Each domain is characterized by the language used by the experts and used to name all the domain concepts and operations. Thus, each domain defines a common language used by both the experts and the development team called a Ubiquitous Language. Translations are not needed anymore, and if the development team uses C# interfaces as bases for its code, the domain expert is able to understand and validate them since all the operations and properties are expressed in the same language that’s used by the expert.

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

What is a DDD_Aggregate

A

Aggregate is a pattern in Domain-Driven Design. A DDD aggregate is a cluster of domain objects that can be treated as a single unit. An example may be an order and its line-items, these will be separate objects, but it’s useful to treat the order (together with its line items) as a single aggregate. An aggregate will have one of its component objects be the aggregate root. Any references from outside the aggregate should only go to the aggregate root. The root can thus ensure the integrity of the aggregate as a whole.

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