Is DDD a waste of time?

OopDomain Driven-Design

Oop Problem Overview


Googling "What kind of applications is DDD suitable for?" gave me the following answer:

> Probably 95% of all software applications fall into the “not so good for using DDD” categories. (see the article)

So what is all the fuss about?!?

The application I am working on is mainly data-centric but still contains some business logic and rules to be applied. Would it be waste of time to start applying DDD techniques? Am I better off using a more conventional Data Access Layer, a model of POCOs and a Business Logic Layer? Or to state it differently - what is a sound alternative to DDD?

Oop Solutions


Solution 1 - Oop

Many developers who think DDD is useful for their project fall into the trap that they think what their job is all about is writing code. This isn't the case. A developer's job is about realizing functionality so a problem can be solved through software. This results in the conclusion that writing code isn't the beginning of what a developer is doing, but the end: the code is the result of the whole process BEFORE the code is actually written.

DDD isn't about writing code, it's not a turn-key 10-step process to get great software, it's about that whole process BEFORE the code is written, it's about getting insight in what the problem is all about, what/who participates in which information streams and what do these elements look like, how do they relate to eachother etc. etc. In fact, the most important part of DDD is creating a language which makes conversations between domain experts and developers possible without misinterpretations. This is the 'Ubiquitous Language' Evans talks about. It in effect makes the whole process BEFORE the code is written a process which leaves little to be guessed, things are clear and straight forward. (that's the goal).

The problem with 'how does DDD work in practise' and 'could anyone give me an example of how I write code with DDD?' and the like is really coming from the fact that the people asking these kind of questions focus on writing code, but have no idea WHY they're writing THAT code and not other code. I.o.w.: if you realize that DDD is about discovering WHAT you've to write as functionality and WHY, things fall into place. HOW you're writing that code, that's up to you. But as said: that's not the biggest problem anymore, as you by then already know what you've to write and why.

Solution 2 - Oop

Sorry but if DDD were only a way of thinking as Frans Bouma says, then it would not recommend such things as Persistence Ignorance. This is dismissing others as somewhat underclass developers.

PI, for which DDD has at least a bias, is an architectural choice. It is not a way of thinking anymore ; it is already something being served to you, with most of the time too vague warnings to be of any use: "not suited for everything".

But deciding to go the PI way or not is a challenge in itself, and you can't call names someone ("a coder") if he feels uneasy about this.

Take an ERP package with all-over the place a MS Access-like interface: grids with running totals, auto-updating columns and pageless scrolling on a 100 000 records. Clearly a DDD approach is suited for thinking of how to go about this app. But in years I have never seen anyone - neither in books nor online, going though evidence backed explanations, let alone real life code examples, of how PI could deal with this ubiquitous situation for anyone wanting to deliver commercial grade apps and user experiences.

Don't want to get religious on this. DDD and DAL proponents tend to be overly religious and may drive away those who have been bitten once but who are/were open-minded. Many just want to confront real-life experiences (i.e. THINK), and not get served with just Cats, Cars, and basic Order/OrdersItems (i.e. poor CODE) to support the preaching.

Solution 3 - Oop

Here is a very similar question: https://stackoverflow.com/questions/796656/do-you-allow-the-web-tier-to-access-the-dal-directly/796961#796961

I use DDD for all my projects. On the smaller applications some of the concepts don't apply, but I find many of the aspects are applicable on all projects regardless of size.

Solution 4 - Oop

you know, sometimes the 5% makes more money than all the other 95% - that's why DDD exists.

it's for specific complex large system.

Solution 5 - Oop

DDD is about software that will be maintained for a while. To me this means that it needs to express ideas that will change with the domain. Sure a simple app may be perfect for a short delivery time and short implementation time. However if you need to grow the software then DDD principles will help immensely. DDD may be hard up front but once you get the idea of the ubiquitous language and the separation concerns then things do start to become easy.

Solution 6 - Oop

If you read the article a little more, you see this:

> For the 5% of applications where DDD > is a good fit, it is a very good fit. > For those situations, DDD will help > you crack a very tough nut. Here, DDD > may be the silver bullet for that > werewolf that your manager just > pointed to your desk.

That's why the fuss about it.

Solution 7 - Oop

  • As your app is mainly data-centric, perhaps your architecture could be mainly conventional.

  • For the aspects where you have more logic and potential domain or value objects, perhaps you could leverage some of the DDD ideas to organize the code.

  • In general, the "sound alternative" is to keep things as simple as possible, use the DDD concepts where useful, and don't unnecessarily complicate things, as the article advises.

I'm starting a similar project now, it is a mix of data manipulation and more logic/algorithm driven areas. I'd similarly like to take the parts of DDD that will benefit the project, but not try to force it on areas where it may be counter-productive.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionJacobEView Question on Stackoverflow
Solution 1 - OopFrans BoumaView Answer on Stackoverflow
Solution 2 - OopIharizaka RahaingosonView Answer on Stackoverflow
Solution 3 - OopChuck ConwayView Answer on Stackoverflow
Solution 4 - OopFrancisView Answer on Stackoverflow
Solution 5 - OopPreet SanghaView Answer on Stackoverflow
Solution 6 - OopMnementhView Answer on Stackoverflow
Solution 7 - OopalchemicalView Answer on Stackoverflow