I was promoted recently as a software architect in a Software development company that produces an Enterprise Content Management product for a customer segment that includes the likes of Insurance companies, Healthcare companies, Research companies and Government agencies.
I had designed moderately complex applications at this organization and my previous jobs.
As a new architect I want to explore Domain Driven Design concepts and various architecture types for migration of our product to a cloud service provider and metamorphize our product from a media based deployment to Software as Service (SAAS) offering.
In my opinion to do this correctly, I will need to create a domain model from the domain for which the software is written.
However the problem I am having is determining what the domain for a product software company is when their products caters to varying needs of disparate customer verticals. I suspect the domain is some kind of meta-domain and not a regular business domain like shipping, insurance or healthcare.
I have following question for this scenario
Question: In terms of Domain Driven Development, what would be the domain of such a company and how can I articulate it so, I can create a domain model?
Identifying the Core Domain can be tricky because the core purpose of your software application can be obfuscated because of all the supporting features that need to be present to make the application useful.
These clues may help you identify and categorize functionality between your Core Domain and Supporting Domains:
Is your software no longer identifiable from a product outside your domain category if you remove a piece of the functionality? You are dealing with a Core Domain.
What is your company's Vision/Mission/Differentiator Statement? They usually reveal the Core Domain.
What category are you and your competitors grouped into in industry reports like Gartner provided? That is your Core Domain.
If your product addresses different customer domains, what common features are used by almost all of them? That is your Core Domain.
Is functionality an industry standard? Does everybody else have it too? Instead of building it, can you buy software off-the-shelf and integrate it into your application, if one were available? If yes, you are dealing with a Supporting Domain.
If you were to remove some functionality because customers do not use it or don't value it enough, would your product still be marketable? That is a Supporting Domain.
Answering these questions will point you in the right direction, but the boundaries of your core domain can be unique to your product's value proposition. Don't hesitate to expand and contract the core domain as the product grows and matures.
Most importantly, talk to your Domain Experts and Salespeople. They usually have a very good idea of what the product pitch is, what is the core value, and what are addons.
I am having difficulty in attempting to ascertain which domain within a given model can be considered the "core domain". It can be tricky especially if there are several domains which are core to the function of a business.
I would like someone to outline a systematic process to single out the core domain when dealing with a system that has multiple candidates.
Core domain - the most important subdomain, which is essential for the business. Without it the business would fail. If you ever need to pick the first solution to implement - start with the core domain.
Supporting subdomain - subdomain, which is less valuable for business than Core domain. Without it business may be can even survive for some time. But it still is quite important (supports core domain), it also is specific for the domain and has to be developed. In this case, for some reason, we can't buy an existing software or component to solve the problem.
Generic subdomain - subdomain which is less valuable for business than Core domain. It also is generic enough to allow buying it off the shelf (unlike supporting domain).
Do you exactly mean multiple core domain candidates or may be it is multiple bounded contexts in core domain?
"Can Core Domain span multiple Bounded Contexts?" - another SO question
Eric asks several questions to help us identity which parts are core
to the domain:
What makes the system worth writing?
Why not buy it off the shelf?
Why not outsource it?
The core domain is so critical and fundamental to the business that it
gives you a competitive advantage and is a foundational concept behind
the business.
Source
a) Do Core Domain and Generic Subdomain ( GS ) in most cases contain different parts of the same domain model or does each GS define its own domain model, which is usually different from the model used in Core Domain?
b) If the former, then I assume the reason for both using the same model is because the primary purpose of GS is to "serve" a Core Domain, and GS can "serve" best if there's no need for a translation layer between the Core Domain and GS ( if each used its own model, then we'd also need a translation layer between the GS and Core Domain )?
thanks
Core Domains, Supporting Subdomains and Generic Subdomains evolve around the concept of the Bounded Context in DDD.
To answer your question, the Core Domain is the domain which makes your business unique and gives you an advantage over your competitors - you will put most efforts (developers/monry) into improving it. A Generic Subdomain handles a topic that is still important but there is a chance you'll find an existing solution (either as a concept or reusable code) that handles the tasks good enough.
The Generic Subdomain would have a different model because it tackles a different domain.
A Generic Subdomain may describe anything from date/time(zone) handling see (2, Ch. 15), persistence, the user-interface toolkit up to a mail server or a complete inventory management system (1, Ch. 2). On the other hand, the inventory management logic is the Core Domain of the inventory management system's vendor.
You can find in-depth information in the book Implementing Domain-Driven Design and of course in the original book introducing Domain-Driven Design by Eric Evans.
Update: (see comment)
In my opinion, the most important aspect in Core Domains using any kind of Subdomain is not to overthink this topic on an abstract level. You'll probably agree that the biggest challenge in Domain-Driven Design is to find good examples that, by plan or accidentally, match the patterns/strategies from the Strategic Design section of the Domain-Driven Design book.
Now, from my understanding, the need for a translation layer between Core Domain and Generic Subdomains arises simply from necessity. In Chapter 15, Distillation of Domain-Driven Design four options on how to develop Generic Subdomains are discussed with their corresponding pros and cons:
An Off-the-Shelf Solution
A Published Design or Model
An Outsourced Implementation
An In-House Implementation
I won't repeat the discussion because this would just include quoting from the excellent book. You'll probably agree that a custom tailored and well-designed in-house solution, that is only used for this project, does not need a translation layer. On the other hand, a commercial or open-source Off-the-Shelf Solution is more likely to require an abstraction because you have little control on how the product evolves, if it has an appropriate Intention-Revealing Interface and so on.
There are two other aspects that are related but should not be mixed up with Subdomains:
Communication between Bounded Contexts
Cohesive Mechanisms
Bounded Contexts need some kind of translation by sheer definition. For each Bounded Context, there is a Model in Context. A Context Map documents the relationships and interactions of Bounded Contexts with Translation Map. The different ways of relating models of BoundedContexts are discussed in Chapter 14, Mainting Model Integrity (Anti-Corruption Layer, Open-Host Service and others).
Cohesive Mechanisms (see Chapter 15 of Domain-Driven Design), on the other hand, are similar to Generic Subdomains as both are introduced to relieve the Core Domain from unnecessary clutter. Eric Evans describes Cohesive Mechanisms as a lightweight framework but admits that in practice the distinction between Cohesive Mechanisms and Generic Subdomains is mostly not pure.
I'd like to say that I had to read those sections again as I do not deal with this on a daily basis so please be forgiving. Additionally, I am not in the inner circle of the DDD community and thus I am not aware if these issues are evaluated differently today. They still seem very useful to me and I have not encountered a better set of tools in this area so I assume they are still valid.
I understand the urge to understand these concepts but a real understanding can only be achieved by looking at concrete examples. Some are mentioned in the books. None of them are claimed perfect. The understanding and assessment of these complex problems, large or small, changes over time and this the soul of DDD in my opinion.
Can somebody please explain (in succinct terms) what exactly is domain driven design? I see the term quite a lot but really don't understand what it is or what it looks like. How does it differ from non-domain driven design?
Also, can somebody explain what a Domain Object is? How does domain differ from normal objects?
EDIT:
As this seem to be a top result on Google and my answer below is not, please refer to this much better answer:
https://stackoverflow.com/a/1222488/1240557
OLD ANSWER (not so complete :))
In order to create good software, you have to know what that software
is all about. You cannot create a banking software system unless you
have a good understanding of what banking is all about, one must
understand the domain of banking.
From: Domain Driven Design by Eric Evans.
This book does a pretty good job of describing DDD.
Register to download a summary of the book.
Domain Driven Design is a methodology and process prescription for the development of complex systems whose focus is mapping activities, tasks, events, and data within a problem domain into the technology artifacts of a solution domain.
The emphasis of Domain Driven Design is to understand the problem domain in order to create an abstract model of the problem domain which can then be implemented in a particular set of technologies. Domain Driven Design as a methodology provides guidelines for how this model development and technology development can result in a system that meets the needs of the people using it while also being robust in the face of change in the problem domain.
The process side of Domain Driven Design involves the collaboration between domain experts, people who know the problem domain, and the design/architecture experts, people who know the solution domain. The idea is to have a shared model with shared language so that as people from these two different domains with their two different perspectives discuss the solution they are actually discussing a shared knowledge base with shared concepts.
The lack of a shared problem domain understanding between the people who need a particular system and the people who are designing and implementing the system seems to be a core impediment to successful projects. Domain Driven Design is a methodology to address this impediment.
It is more than having an object model. The focus is really about the shared communication and improving collaboration so that the actual needs within the problem domain can be discovered and an appropriate solution created to meet those needs.
Domain-Driven Design: The Good and The Challenging provides a brief overview with this comment:
DDD helps discover the top-level architecture and inform about the
mechanics and dynamics of the domain that the software needs to
replicate. Concretely, it means that a well done DDD analysis
minimizes misunderstandings between domain experts and software
architects, and it reduces the subsequent number of expensive requests
for change. By splitting the domain complexity in smaller contexts,
DDD avoids forcing project architects to design a bloated object
model, which is where a lot of time is lost in working out
implementation details — in part because the number of entities to
deal with often grows beyond the size of conference-room white boards.
Also see this article Domain Driven Design for Services Architecture which provides a short example. The article provides the following thumbnail description of Domain Driven Design.
Domain Driven Design advocates modeling based on the reality of
business as relevant to our use cases. As it is now getting older and
hype level decreasing, many of us forget that the DDD approach really
helps in understanding the problem at hand and design software towards
the common understanding of the solution. When building applications,
DDD talks about problems as domains and subdomains. It describes
independent steps/areas of problems as bounded contexts, emphasizes a
common language to talk about these problems, and adds many technical
concepts, like entities, value objects and aggregate root rules to
support the implementation.
Martin Fowler has written a number of articles in which Domain Driven Design as a methodology is mentioned. For instance this article, BoundedContext, provides an overview of the bounded context concept from Domain Driven Development.
In those younger days we were advised to build a unified model of the
entire business, but DDD recognizes that we've learned that "total
unification of the domain model for a large system will not be
feasible or cost-effective" 1. So instead DDD divides up a large
system into Bounded Contexts, each of which can have a unified model -
essentially a way of structuring MultipleCanonicalModels.
You CAN ONLY understand Domain driven design by first comprehending what the following are:
What is a domain?
The field for which a system is built. Airport management, insurance sales, coffee shops, orbital flight, you name it.
It's not unusual for an application to span several different domains. For example, an online retail system might be working in the domains of shipping (picking appropriate ways to deliver, depending on items and destination), pricing (including promotions and user-specific pricing by, say, location), and recommendations (calculating related products by purchase history).
What is a model?
"A useful approximation to the problem at hand." -- Gerry Sussman
An Employee class is not a real employee. It models a real employee. We know that the model does not capture everything about real employees, and that's not the point of it. It's only meant to capture what we are interested in for the current context.
Different domains may be interested in different ways to model the same thing. For example, the salary department and the human resources department may model employees in different ways.
What is a domain model?
A model for a domain.
What is Domain-Driven Design (DDD)?
It is a development approach that deeply values the domain model and connects it to the implementation. DDD was coined and initially developed by Eric Evans.
Culled from here
Here is another good article that you may check out on Domain Driven Design. if your application is anything serious than college assignment. The basic premise is structure everything around your entities and have a strong domain model. Differentiate between services that provide infrastructure related things (like sending email, persisting data) and services that actually do things that are your core business requirments.
Hope that helps.
As in TDD & BDD you/ team focus the most on test and behavior of the system than code implementation.
Similar way when system analyst, product owner, development team and ofcourse the code - entities/ classes, variables, functions, user interfaces processes communicate using the same language, its called Domain Driven Design
DDD is a thought process. When modeling a design of software you need to keep business domain/process in the center of attention rather than data structures, data flows, technology, internal and external dependencies.
There are many approaches to model systerm using DDD
event sourcing (using events as a single source of truth)
relational databases
graph databases
using functional languages
Domain object:
In very naive words, an object which
has name based on business process/flow
has complete control on its internal state i.e exposes methods to manipulate state.
always fulfill all business invariants/business rules in context of its use.
follows single responsibility principle
DDD(domain driven design) is a useful concept for analyse of requirements of a project and handling the complexity of these requirements.Before that people were analysing these requirements with considering the relationships between classes and tables and in fact their design were based on database tables relationships it is not old but it has some problems:
In big projects with complex requirements it is not useful although this is a great way of design for small projects.
when you are dealing with none technical persons that they don,t have technical concept, this conflict may cause some huge problems in our project.
So DDD handle the first problem with considering the main project as a Domain and splitting each part of this project to small pieces which we are famous to Bounded Context and each of them do not have any influence on other pieces.
And the second problem has been solved with a ubiquitous language which is a common language between technical team members and Product owners which are not technical but have enough knowledge about their requirements
Generally the simple definition for Domain is the main project that makes money for the owners and other teams.
I do not want to repeat others' answers, so, in short I explain some common misunderstanding
Practical resource: PATTERNS, PRINCIPLES, AND PRACTICES OF DOMAIN-DRIVEN DESIGN by Scott Millett
It is a methodology for complicated business systems. It takes all the technical matters out when communicating with business experts
It provides an extensive understanding of (simplified and distilled model of) business across the whole dev team.
it keeps business model in sync with code model by using ubiquitous language (the language understood by the whole dev team, business experts, business analysts, ...), which is used for communication within the dev team or dev with other teams
It has nothing to do with Project Management. Although it can be perfectly used in project management methods like Agile.
You should avoid using it all across your project
DDD stresses the need to focus the most effort on the core subdomain. The core subdomain is the
area of your product that will be the difference between it being a success and it being a failure. It’s
the product’s unique selling point, the reason it is being built rather than bought.
Basically, it is because it takes too much time and effort. So, it is suggested to break down the whole domain into subdomain and just apply it in those with high business value. (ex not in generic subdomain like email, ...)
It is not object oriented programming. It is mostly problem solving approach and (sometimes) you do not need to use OO patterns (such as Gang of Four) in your domain models. Simply because it can not be understood by Business Experts (they do not know much about Factory, Decorator, ...). There are even some patterns in DDD (such as The Transaction Script, Table Module) which are not 100% in line with OO concepts.
I believe the following pdf will give you the bigger picture. Domain Driven Design by Eric Evans
NOTE: Think of a project you can work on, apply the little things you understood and see best practices. It will help you to grow your ability to the micro service architecture design approach too.
Get an organization wide understanding of the problem domain by
developing a ubiquitous language (a common mental model) per sub-problem-domain.
Use that language as close as possible in solution domains (code).
Only then choose technologies.
Don't be technology driven but problem domain or business driven.
I read that Domain Driven Design is about concentrating on the problem domain instead of concentrating on the software. They say that it is easier to solve the complexities of the problem domain than the complexities of the software, because after you have solved the domain, you know better how to build the software, too. Also they say that actually the domain is more complex than the structures of the software or that if you don't see the forest from the woods, you are in trouble.
But how is Domain Driven Design different from just using a specification for the software? I mean, of course we should get to know the problem domain before we start coding. Is DDD reinventing the wheel?
Domain-driven design is more about establishing a common model of the world (and an associated common language) that both you and the domain experts can use.
In theory this means that developers can write code that reads like a description of the problem domain, and domain experts can look over developers' shoulders and see what's going on.
A specification makes no such promises about a common language or model of the world, it just says "we're going to build something specific". The highly specified class model you come up with might work, but it may not reflect 'reality' particularly well.
There's a good free book on Domain-Driven design here (login required unfortunately).