Every single time I pick Domain driven design for one of my projects or layers, I regret using it! But it’s not the whole story…
Over years of software development, One thing is crystal clear to me:
As a developer, You put most of your effort on the maintenance phase of a software. Meaning that maintaining a software, takes more time that developing it!
I’m not going to dive in the reason behind this. Yet what we know is: such an important phase of software development should be attended more.
The fact is: almost all the approaches we use in programming (such as OOP,SOLID,Design Patterns…) aim to reduce the complexity of the software and lead to a cleaner code. So what? The answer is clear: A clean code is easier to maintain.
The fact is that: Using all those patterns and object oriented complex approaches without having a standard framework, may lead to more complexity. That is why some OOP codes are harder to read than the Not-OOP ones.
Domain Driven Design is the answer to this problem.
But what I’m going to talk about in this article, is not the DDD itself. It is about the fact that: Using some approaches, make the development phase, harder and longer.
Yes it is true. But you should know: A shorter code is not necessarily a better and cleaner code. Let’s take nTier approaches as an example. We write all those layers and extra codes just to shape the code into a more standard form. A form that is more readable not to us (as we know what we have written) but to other human beings who are going to read our code later.
We write all those unit tests to help the other developers, not to be able to edit our codes in a wrong way!
So Yes! Domain Driven Design is hard to learn. Harder to master and even harder to implement. You will need to write so many extra lines of code. Use all those interfaces, Services, Domain models etc… for what?
Just because it is damn good in the maintenance phase of software life cycle.
remember I told you that “Every single time I pick Domain driven design for one of my projects or layers, I regret using it! “? But after that, I feel proud every time that I edit that code. Cause it is so much easy to maintain. That is why every single time I regret, but I choose DDD approach for my next project!
If you believe the complexity level of your project is suitable to use DDD go for it and do not regret!