What is a Domain?
Learn the meaning of domain and its importance in the DDD world.
We'll cover the following
Everyone in technology always talks about how important it is to understand the context of the problem that needs to be solved. However, this step is often overlooked. The process to find a solution becomes even more complex when we try to solve it beyond just the programming context. Once we start to consider other teams and more steps, it becomes more difficult to fully understand the problem and keep contexts straight. This is when Domain Driven Design comes to the rescue.
Defining a domain
In the upcoming lessons, we’ll analyze DDD deeply. But, for now, let us understand what a “domain” is.
According to the Oxford Dictionary, a domain is “an area of knowledge or activity; especially one that somebody is responsible for”. This definition is a little puzzling and abstract. Therefore, let us make it easier to understand. A domain is a set of activities or processes, and it consists of experts that are responsible for the execution of these activities. A domain can be as large or small as is needed. Let us look at a couple of examples to better understand the concept of a domain.
Understanding domain through examples
According to the previous definition, let us look at some examples of a domain to further clarify the meaning of the term.
Banking services
The first example is related to banking services. An average bank deals with numerous activities, such as loans and account management, ATM operation, payroll management, customer support, and so on. In terms of responsibilities, each activity is executed by an expert who knows how to carry out that specific activity in the best way:
The image above shows some activities that can be involved when it comes to analyzing a bank. In this case, it shows a loan, credit card, account, employee, and ATM. It is important to clarify that some activities can be part of the core business processes, whereas others can support the main activities.
E-commerce services
The second example is related to an e-commerce website. This type of company consists of a huge number of activities, too. The image below shows some of the activities that may take place on an e-commerce website. It may feature activities like payments, website development, shipments, stocks, and sales. Each of these activities is executed by an expert.
Summary
A domain in DDD is the field or industry in which a company operates. A domain can account for many different parts. People will be successful at DDD if they understand the domain they need to model.