Domain Driven Design (DDD)

Domain-Driven Design (DDD) is a collection of principles and patterns that help developers to create software abstractions called domain models. These models highly expressive and encapsulate business logic.These models will  bridge the gap between business and code . These models that is understandable by all the stake holders involved in the project and not just software developers.

For non technical people, the models can be represented in different ways. Typically, a model of a domain can be depicted as a UML diagram, as code, and in the language of the domain.

As an example of using language,
A user wants to order a book online. He searches for the book based on Author, Title. This book is available, user can purchase the book. An order number is issued which the user can use to track the order status.
The language used has to do more with the concepts. It has to explain what the intention is. How the it is implemented is not significance. This helps in better interaction with the developers and the domain experts.

As an example,
A user wants to order a book online. He searches for the book based on Author, Title. If this book is available, user can purchase the book. The user Credit Card is validated by calling a Web Service offered by a third party vendor. Once validated, an order number is issued which the user can use to track the order status.

Here the validating credit card is important. But the Web Service is the implementation, which is insignificant.
So the language used to model the concept must be in line with those of the domain experts.
To have a better understanding the concepts can be explained as "Stories" or "Scenarios". This is the key in Behavior-Driven Development (BDD). What is in story , http://dannorth.net/whats-in-a-story is an interesting article.

Story usually tells about a user wants to do an action, so that he will be benefited. So the above model can be rephrased as,

Story about Buying a Book.
I want to search for a book on Java. I want to buy that. This will help to improve my Java Knowledge.
As the story develops, it will have turning points or scenarios.
Scenarios for the story will be like, 'When' the book is out of print, 'Then' add this book to my wish list and send me a mail when book is available. 'When' describes and event, and 'Then' explains what is the outcome of that event.
Lot of discussion happens around DDD. Some good resources
http://msdn.microsoft.com/en-us/magazine/dd419654.aspx
http://dddstepbystep.com/

No comments:

Post a Comment