ELI5: Explain Like I'm 5

Domain-driven design

Domain-driven design is a way of building computer programs that helps us to understand how they work. It’s like building a house. When we build a house, we start with the plans, then we create the foundation, walls and the roof. In domain-driven design, we start with understanding the problem we want to solve, and then we create the foundations, walls and roof of our program.

To better understand domain-driven design, let’s pretend that we want to build a program that helps us to manage our toy collection. First, we need to understand the problem we want to solve. This involves thinking about what kinds of toys we have, how we want to organize them, and how we want to interact with them. Only then can we design the program that will help us do that.

Next, we create the foundation of our program. This is where we define the basic elements of our toy collection, like the different types of toys we have (such as action figures, dolls or board games), and what information we want to keep about each of them (like their name, manufacturer, year released and so on).

Then, we build the walls of our program. This is where we define how we interact with our toy collection - how we add new toys, remove them, and search through them. We also need to think about the rules for how our toy collection operates. For example, we should not be able to add the same toy twice, and we might need to know how to price each toy for a potential sale.

Finally, we put on the roof of our program. This is where we make sure everything works as expected. We test our program to make sure it can handle different kinds of toys, different ways of interacting with the toys, and different rules.

By using domain-driven design, we can build a program that better reflects the problem we want to solve. We have a better understanding of the problem, which helps us make better decisions about how to implement the solution.