Skyframe Documentation
Domain-Driven Design (DDD)
Domain-Driven Design (DDD)
Introduction
Domain-driven design (DDD) is an architectural pattern that provides a structure of practices and terminology for making decisions that accelerate software projects dealing with complicated business logic.
To understand domain-driven design we should first establish what we mean by domain in software development.
Business logic
Business logic or domain logic is that part of your application which encodes the real-world business rules that determine how data can be created, stored, and changed. It prescribes how business objects interact with one another, and enforces the routes and the methods by which business objects are accessed and updated.
Domain entities
We define those "business objects" as Entities and the Domain as a set of Entities interacting with business processes and changing the state of information.
Entities are objects meant to be unique within the domain. This is achieved by using one or more proprieties to identify a given entity. For example, two users (two instances of the User Entity) using the same name in a system will always have different emails because emails cannot be repeated .