Companies naturally expand over time, and each department purchases the equipment it needs for its tasks and workflow. Naturally, this leads to the creation of duplicate databases that frequently use various languages for the same data. Unique User IDs may be present in one solution, Customer IDs in another from a different department, and Client IDs in others. As a result, developing consistent processes between departments becomes challenging and complex. Even meetings between different departments can't sometimes solve this, since they are all using slightly different language, even though they are talking about the same thing in practice.
This continuous process produces bottom-up solutions, tools, and processes. In order to get all the many, slightly different, and mismatched elements to work together and provide the desired results, highly complicated tools, and translation layers are then required.
The development team then needs to somehow transform all this complexity into procedures they can comprehend and build software around.
As teams grow and processes get more complex, it is essential that everyone speaks the same language and agrees on how the process should function. A top-to-bottom strategy is required.
Enter Domain-Driven Design
Domain-driven design was required to handle all of this complexity. The initial ideas required to solve these problems were explored by Eric Evans in his book "Domain-Driven Design: Tackling Complexity in the Heart of Software."
Domain-driven design requires a system of cooperation as opposed to the creation of translation layers between different software solutions. Communication and understanding between technical and non-technical parties are essential. They must establish a shared language that will ultimately be advantageous to the company and the software solution being developed.
Domain-driven design focuses on 3 core principles:
- It concentrates on the particular domain and domain logic (processes)
- The target domain's models serve as the foundation for the design itself (software based on process, not process based on the available or historic software)
- Constant interaction with subject-matter experts to enhance the application and fix any problems that might come up with what the domain is doing.
This implies that domain-driven designs are a technique for the software development team to better comprehend an organization's difficulties by concentrating initially on how the business performs its work. To create a common language and conceptual models, close cooperation with subject matter specialists is necessary.
Domain-driven design defines a few essential terms and layers to overcome this communication barrier:
- The word "domain model" refers to the collection of all business concepts, knowledge, and data that are pertinent to the issue at hand.
- Subdomain: The big domain can frequently be broken into more compact subdomains. These are connected to the various problems they deal with inside the domain; for instance, shipping is a subdomain of e-commerce. The same goes for client databases or payment systems.
- Bounded context - Depending on how complicated the domain and subdomains become, it may be required to further restrict the context being addressed. For example, there is a pre-sale process and an after-sale procedure with subdomain sales.
- Domain logic, often known as business logic, is the business process that controls how and what data is handled, modified, and made available.
- Design patterns are reusable, previously written sections of code that can be used by multiple program units.
- Ubiquitous Language – terminology that has been agreed upon by all parties concerned. Each field and its professionals have its own terminology and language of expertise. All components of the design and development process must use the same concepts and language.
A few layers are also specified to aid in breaking down all of these separate elements and grouping them for software development:
- The User Interface (Presentation layer) presents information to the user and receives commands; in other words, the GUI Application layer: coordinates application activities. This layer administers the application and contains no business logic.
- Domain layer: This layer contains all the relevant information about the business domain, its subdomains, and its processes.
- The infrastructure layer is the application's bottom level of support. This is usually the infrastructure and hardware level required to make the program work.
The domain-driver design method has a number of benefits:
- By using the same terminology in interactions between technical and non-technical team members, communication is greatly improved.
- Because domain experts and actual users must participate in all talks, the final product is frequently very user-focused. Because it responds to the very unique demands of the domain consumers, it results in a far better user experience and interface.
- The product is created by a team of software developers rather than just one group of managers, which results in a lot more effective product. The solution simply accomplishes the goals of the domain experts; it does not include features that managers or developers would deem desirable.
It is also important to note that lengthy development cycles might result from the numerous stakeholders involved. Domain-driven design is better suited for extremely complicated products when combined with other pre-existing methodologies (like Agile development), but it can be too much for simpler processes.