The world of software development has seen a drastic transformation over the past 15 years. From a time when developers focused on simply getting the implementation project or architecture up and running. To today, where a programmer is expected to manage the entire production process, from understanding the needs and problems of a customer to delivering value. This is where Domain-Driven Design (DDD) comes in. DDD is an approach to software development that helps to build consistent systems that can quickly and easily adapt to changing application requirements. In this blog, we will discuss the advantages of using DDD and how to effectively implement it.
Table of contents:
- What is domain-driven design?
- How can you design a solution for a problem you don’t understand?
- Why using popular tools might not be the best solution to solve the problem?
- What is Event Storming?
- How did we get to a Domain-Driven design model?
- Does using what’s free really beat Domain-Driven Design?
- Implementing Domain-Driven Design is what’s best for business
What is Domain-Driven Design?
Domain-driven design is an approach to developing software for complex needs by deeply connecting the implementation to an evolving model of core business concepts. Its emphasis on domain knowledge and understanding of how the end-user will make use of the software within the context of a business makes it particularly useful for enterprise software development.
At its heart, DDD is about two things:
- Ubiquities language: using the same language domain experts use in programs. This causes us to write the code the way a domain expert would write it.
- Domain models: structuring the code in a way that encapsulates the business logic and makes it easy to change.
In short – Domain-driven design focuses on the development of a domain model that software developers can use to create a software solution that meets the specific needs of the client.
How can you design a solution for a problem you don’t understand?
DDD is NOT a silver bullet for all software development problems. I wouldn’t recommend using DDD for tasks with simple solutions. But it can be very effective in certain situations, particularly when developing large-scale enterprise applications. As software engineers, it is our task to create solutions to our client’s needs. And you can’t do that if you don’t understand, or aren’t involved with the problem from the start. The ideal situation for the client is that they should describe the problem and, as an engineer, you describe the solution. And we can only do that if we understand the business.
Domain-driven design is an approach to software development that focuses on developing a deep understanding of the problem domain. This understanding is used to drive the development of the software solution. Take, for example, my recent trip to Germany. I am in a position to be able to visit my clients (read more about Beckerbillett here). Getting hands-on with the technology afforded me the understanding to offer solutions to their needs.
It is our job to be able to offer the best solutions and using a DDD approach makes it easier to design systems for clients. And in my opinion, it has been a huge game changer. You shouldn’t just be a coder, you should be a designer. You should design solutions to problems and by ignoring a DDD approach you are closing doors and opportunities.
Why using popular tools might not be the best solution to solve the problem?
Another piece of the puzzle for projects is the number of ways to approach a situation. Currently, we have an excess of tools, patterns, and ways to solve any problem, such as TDD, BDD, design patterns, application patterns, etc. It is very important to understand why we are using something. Moreover, that knowledge of why should be shared with the whole team. In addition, most systems boil down to creating an application that already exists somewhere in the world. This whole overload pushed engineers to the other extreme and the phenomenon of overengineering arose. Using what is fashionable to solve the problem, what can such a phenomenon lead to? The answer suggests the creation of uncontrolled technical debt and the failure of the project.
How to avoid it? Again, understand the client’s business and engineer a solution to their needs. To achieve this goal, DDD employs a number of techniques, including domain modeling and Event Storming.
What is Event Storming?
Event Storming is a flexible workshop format for the collaborative exploration of complex business domains, that can be used to assess the health of an existing line of business; discover the most effective areas for improvement; explore the viability of a new startup business model; envision new services that maximize positive outcomes for all parties involved; and design clean and maintainable Event-Driven software. This adaptive nature of Event Storming enables cross-discipline conversation between stakeholders with different backgrounds, allowing for a new type of collaboration beyond silo and specialization boundaries.
How did we get to a Domain-Driven design model?
I would divide programming into several periods. The first stage was the emergence of object-oriented languages. All programs were written as they were understood or as the engineer knew how to write for a given business requirement. Business analysts set a task list, programmers would pick one, code for it and that was that. It had one major drawback, software developers were only limited to select parts of the design process. It limited their involvement and affected how they approached a problem. How DDD solves this issue is by placing engineers at the beginning of the design process. Giving engineers the chance of a say in the complete process helps create a tailored response to a client’s needs.
The next stage was the stage leading to the creation of DDD (domain-driven design) in 2005. At that time, engineers tried to model business behavior in objects to somehow connect them, but the border was still a problem. If the program was made by one engineer, it was ok, but if several engineers worked on one program, there were problems. DDD has solved this by placing an emphasis on engineers setting out the project’s workflow.
Does using what’s free really beat Domain-Driven Design?
There is another factor in this whole open-source software puzzle. There is a lot of code that is available for free with the possibility of using it commercially. Why hire a team when you can have something for free in a week?
In short, being free doesn’t mean it will work for you. DDD is an effective approach to software development. It helps software developers to develop a deep understanding of the problem domain. Limiting a developer to what is available at the lowest cost constrains the ways in which they can approach a situation. It can get the project off to a bad start and affect the technical debt and foundations of a project moving forward. This is a big problem if you need to upscale the project in the future. A better solution is to give the engineers the technology that is the best fit for the business’ problems. And the only way you can do this is to understand the business needs from the early planning stages. This lowers the chances of technical debt and protects the project for the future.
Implementing Domain-Driven Design is what’s best for business
Based on all this, I can say that code is business. If you do something exactly like everyone else, you have to compete on price. Competing on price means you have to have deep pockets or the shortest supply chain in the world. If code is business, you need engineers who are aware of the business, understand it, and help improve it.
My advice is: write your core business, protect it, and tailor it like no one else, everything else can be integrated. If your business stands out in the market in such a way that customers will appreciate it, then you are in the winning position. As a software engineer, it is important to have a strong understanding of business in order to effectively solve your clients’ problems. Without this understanding, it can be difficult to fully grasp the scope and requirements of a project, leading to potential missteps and misunderstandings.
If you want to talk more about this, feel free to get in contact.