Beginner: How to deal with complex domain model? How to interact on modular domain model with CQRS?

88 views
Skip to first unread message

Screaming Dev

unread,
Aug 25, 2016, 8:32:24 AM8/25/16
to DDD/CQRS
Hello,

I just try things with CQRS but now it is getting more serious and I want to have it proper and clean. But I can't handle the DomainModel and CQRS:

This is the DomainModel for the "incoming editable" data:

  • Person
    • getName
    • getDescription
    • getCars
  • Cars (maybe ValueObject)
    • Bodywork
    • Engine
    • Seats
    • Wheels
Simple as that. But there is more in the domain. Some Documents that is generated out of that data (only the classes are listed here):
  • Documents
    • SimpleOffer
      • Advantages
      • Cost
      • Terms
    • FleetOffer
      • Cost
      • Terms
    • DetailledOffer
      • Advantages
      • Cost
      • Packages
        • Color
        • Engine
        • Inside
      • Financing
      • Terms
There are some more documents and they divide from the above a bit. Each section will have a topic and text.

QUESTION: Do I create a class for each document and all it's segment?

In DDD/CQRS terms this should be done I guess. But instead I could have some abstract document and sections to model everything. This is quick but dirty I guess. Could you give me a hint how and what should be done here?

Furthermore the CQRS part will be that one data set comes in (first part) and it generates one of the documents (second part, e.g. DetailledOffer).

Johanna Belanger

unread,
Aug 26, 2016, 5:34:54 PM8/26/16
to DDD/CQRS
It depends. =)

It's not that one of those models is better than the other, it's that you need a model that serves your situation well.

From the information here, it's hard to tell much about your situation. You've described the structure of the data, but not much about things that happen

For a start, are there a lot of business calculations that transform the Person and Car data into Offers? Or are the Offers static documents that need to have the Person and Car data inserted?

bklo...@gmail.com

unread,
Aug 26, 2016, 7:20:15 PM8/26/16
to ddd...@googlegroups.com
Start with the behavior  which you have not mentioned.  Then look at structures to support that.

Sent from my Windows Phone

From: Screaming Dev
Sent: ‎25/‎08/‎2016 10:32 PM
To: DDD/CQRS
Subject: [DDD/CQRS] Beginner: How to deal with complex domain model? How tointeract on modular domain model with CQRS?

--
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