Friday, 6 November 2020

Mixing DDD , OOP and Modularity

The world map is a model of the Earth, it tries to solve a specific problem of planning shipping routes. As you can see Greenland is much much bigger than it is in reality, but this is because the purpose of the map is to find angles to sail, not to display the relative sizes of parts of the world. This is the most important concept for DDD because when we write software (using OOP in particular, more on this later) we are actually solving a problem by creating a model (since OOP based upon concepts and 'real things')  

For example when creating a program that models an air conditioning fan (it could be anything, a network, architecture, command processor) we need to find out what problem exactly we are trying to solve with the model. You can try to model the fan taking into account everything such as its weight, colour, year of purchase.etc but if you place a problem ontop of the model, you can really simplify your model down to an elegant solution. This is very important since software complexity is the major battle we have when creating programs.

In software we aim to create highly modular programs. We do this because it makes the software easier to create and maintain since we only have to think about a small set of things at a time.

Using the OOP paradigm, objects are supposed replicate real-life things (as Bertrand Meyer puts) as a "cousin twice removed" from reality. So, to modularize our OOP programs into simplified models provides a perfect match. 

  1. OOP for modelling concepts as objects.
  2. Models made from objects for solving a problem.
  3. Models divided into contexts to modularize our software.

Some links

Here is the talk Eric gives that explains it:

It's very difficult to summarise such a large topic but here are some links that explain the concepts.



No comments:

Post a comment

The difference between class and object.

 The difference between class and object is subtle and misunderstood frequently. It is important to understand the difference in order to wr...