kdocs
GitHub
SC - Software Architecture
SC - Software Architecture
  • About
    • Architectural Requirements (RAs)
    • Architectural Perspectives
  • Software Design
    • Microservices
      • Patterns
    • Monolithic
    • C4 Model
  • Software Architectures
    • Clean Architecture
    • DDD (Domain Driven Design)
      • Strategic Modeling
      • Tactical Modeling
    • Event Driven Architecture
      • CAP Theorem
    • Hexagonal Architecture (Ports and Adapters)
  • Design Patterns
    • Behavioral
    • Creational
    • Data Access
    • Structural
  • Practices
    • Clean Code
    • SOLID
  • Others
    • CQRS
Powered by GitBook
On this page
  • What is DDD?
  • Usability
  • How DDD helps?
  • Context Map
  • Integration Patterns
  1. Software Architectures

DDD (Domain Driven Design)

PreviousClean ArchitectureNextStrategic Modeling

Last updated 4 months ago

What is DDD?

It is a way to develop software focusing at the heart of the application - called - with the objective of understanding its rules, processes and complexities, and separating them from other complex topics that usually are added during development.

It is about modeling a Ubiquitous Language in an explicitly .

Usability

DDD is/should be used for complex softwares.

  • Big projects have many areas, many business rules, many people with different visions in different contexts.

  • A lot of the complexity from this softwares are not technological, but communicational, from separating contexts, understanding of the business from many angles.

The challenge is to balance the amount of needed information to preserve the invariance and the resource consumption (like memory), since the seggregation of Domains and Subdomains can increase the amount of code and memory usage.

DDD always breaks down into two sections:

  • Tactical Modeling, helps on building the Domain Model, separating your Core/Domain entities into Domain Objects, complementing Clean Architecture Entity Layer.

  • Strategic Modeling, to help divide your application code into separate code bases, depending on Domains and Subdomains.

That are used for different reasons, together or separated.

How DDD helps?

Helps understanding the deepness of the Domain and Subdomains of the application.

⭐ Helps in having a universal language (Ubiquitous Language) between everyone involved. (From the software specification until the variables names used in the code)

  • Think of the meaning of the word Client for different areas of the business. They could have different meanings and refer to different things.

  • So having everyone speak the same language is indispensable.

Helps showing what is business complexities and what is technical complexities.

Context Map

  • The interaction between bounded contexts is by a Context Map.

Integration Patterns

  • The integration patterns naturally define the relationship type between each bounded context.

Partnership

Shared Kernel

  • Collection of code that can be shared like a npm package. It will be used by multiple bounded contexts.

  • Using code versioning like Semantic Versioning 1.0.0.

Customer/Supplier

  • You have the Upstream (The consumed) and Downstream (Who consumes).

  • There is a supply relationship where the customer and the supplier may determine how the contract between them should be.

Conformist

  • The downstream must accept what the upstream gives him.

  • Brings the risk of accepting the nomenclature of the upstream into your code.

  • Usually requires an Anti-Corruption layer.

Anti-Corruption Layer

  • Is a layer to translate nomenclatures that come from upstreams.

    • Like when conforming.

Open-host Service

  • When you offer services to the outside.

  • You try to simplify the internal complex logic, by providing the simpler interface for the outside world.

Helps creating a strategic design using .

Bounded Contexts
Domain
Bounded Context