Building Complex Software with Domain Expertise
Domain-Driven Design (DDD) is a software development approach introduced by Eric Evans that focuses on creating software that reflects a deep understanding of the business domain.
DD emphasizes collaboration between technical and domain experts, using a shared language (Ubiquitous Language) and organizing code around domain concepts rather than technical infrastructure.
// Value Object - defined by attributes
private BigDecimal amount;
private Currency currency;
throw new IllegalStateException("Cannot modify shipped order");
items.add(new OrderItem(productId, quantity, price));
if (!canBeShipped()) {
Frequently asked questions
What is Domain-Driven Design?
void save(Order order);
What does 'Ubiquitous Language' refer to in Domain-Driven Design?
List findByCustomerId(CustomerId custome?
Where would you typically implement database interactions in DDD?
// Implementation in infrastructure layer
What is the purpose of the JpaOrderRepository class?
class JpaOrderRepository implements OrderRepository {
▶ Try it live
Everything above runs in your browser — open Hash Function Avalanche Visualizer and change the parameters while it is running. Nothing is installed, nothing is uploaded, the whole model lives in one tab.