Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Design Methodology: use case driven vs. domain driven

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?

like image 938
zs2020 Avatar asked Jul 03 '10 22:07

zs2020


People also ask

Is Domain-Driven Design a methodology?

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.

What is a use case domain driven?

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.

What is Domain-Driven Design model?

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.

What is the difference between DDD and clean architecture?

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.


2 Answers

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.

like image 140
Vijay Patel Avatar answered Oct 11 '22 05:10

Vijay Patel


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.

like image 37
Adrian K Avatar answered Oct 11 '22 06:10

Adrian K