Migrating an anemic domain model to DDD / CQRS

227 views
Skip to first unread message

Sebastian Stehle

unread,
Apr 30, 2015, 1:37:35 AM4/30/15
to ddd...@googlegroups.com
Hello together,

I want to migrate a part of the application which is very data centric to a rich domain model to improve maintainablity and testing (dont know if it will work well). I already use some kind of a cqrs pattern where I have two databases. When an entity is changed on the write side I send the id via a bus to the read side which fetchs all data from the write database and updates its entities (this is also a little bit problematic).

Now I have the problem that there are so many DTO's I have to manage, which look very similar in many cases:

1.  API Model (I use WebAPI), I also use the api model in the consumer applications.
1. Commands
2. Domain Objects (if they need to expose some or all information via properties)
4. Events
5. Read Models

It is really a pain to many all these DTO's and keep them in sync. How do you manage this?

@yreynhout

unread,
Apr 30, 2015, 6:22:17 AM4/30/15
to ddd...@googlegroups.com
You go back to doing CRUD?

Alberto Brandolini

unread,
Apr 30, 2015, 8:35:47 AM4/30/15
to ddd...@googlegroups.com
Hi Sebastian, 

Il giorno gio 30 apr 2015 alle ore 07:37 Sebastian Stehle <sebastia...@busliniensuche.de> ha scritto:
Hello together,


When you say..
 
I want to migrate a part of the application which is very data centric to a rich domain model to improve maintainablity and testing (dont know if it will work well).

You got me wondering whether this is really the goal. 
I'd look for a strong business rationale (which will likely not be applied flat on the whole application) and for stronger separation of purposes/models/bounded contexts.

Touching the wires before clarifying that part sounds like danger to me.

Alberto

 
I already use some kind of a cqrs pattern where I have two databases. When an entity is changed on the write side I send the id via a bus to the read side which fetchs all data from the write database and updates its entities (this is also a little bit problematic).

Now I have the problem that there are so many DTO's I have to manage, which look very similar in many cases:

1.  API Model (I use WebAPI), I also use the api model in the consumer applications.
1. Commands
2. Domain Objects (if they need to expose some or all information via properties)
4. Events
5. Read Models

It is really a pain to many all these DTO's and keep them in sync. How do you manage this?

--
You received this message because you are subscribed to the Google Groups "DDD/CQRS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dddcqrs+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages