Just for discussion, to me it seems that 2 different terminologies actually are saying the same thing. Is there any tangible differences between this 2 design approaches?
Domain-Driven Design 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.
Use Cases focus on Users, Actions, and Processes. This is great from a business perspective, because everyone can see an abstracted view of what the system will provide. DDD focuses on creating software that solves problems.
Domain-Driven Design(DDD) is a collection of principles and patterns that help developers craft elegant object systems. Properly applied it can lead to software abstractions called domain models. These models encapsulate complex business logic, closing the gap between business reality and code.
DDD is used to model the domain entities encapsulating intra-aggregate invariants (validators in constructors). Use cases (from Clean Architecture) are used to orchestrate inter-aggregate business logic in a comprehensible and a targeted way.
Use Cases focus on Users, Actions, and Processes. This is great from a business perspective, because everyone can see an abstracted view of what the system will provide.
DDD focuses on creating software that solves problems. The 'Who can solve this?' and the 'What process will they follow?' come afterwards.
DDD really gets to the core problems earlier in the design process, and helps you structure your solution (i.e. identifying Entities, Value Objects, Respositories, Domain/Application/Infrastructure services, Bounded Contexts, Specifications, etc).
Use Cases don't cater for this at all, or how to manage your development (Anti-Corruption Layers, Separate Ways, etc)
In my experience, DDD offers more flexibility (changing requirements anyone?), and provides the foundations for your Use Cases. Once you've got your Domain Model in place, Use Cases can be implemented using Controllers/Workflow Engines/UIs that connect with your Domain Model. Quite often, I've identified gaps in business requirements just by building Domain Models.
And having attended a talk by Ivar Jacobsen some years ago, I would also say that DDD is better suited to Agile.
To me, Domain-Driven Design (DDD) is more "all emcompassing"; where as Use Cases are just a tool that focus on a specific view: how a something responds to stimulus and are used to capture or document behavioral requirements.
To me, the term "domain" is a loaded one - it infers a wider view of all the concepts relevant to a specific problem area.
When describing how parts of the domain interact - specifically how they respond to stimulus then you might use Use Cases.
As far as an approach goes: Use Cases are the "additional" view in the 4+1 Architectural View Model, but they aren't a design approach on their own.
Another distinction is that DDD is often very closely tied to an Object Orientated model or system; in this way DDD captures / respresents (amongst other things) the structure of a system - some thing Use Cases don't do.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With