Things go wrong a lot; and frequently the problems start in the initial stages.
So I made a thread to share my thoughts and tips on the subject of starting out.
(Please comment. I love feedback.)
Step one is to forget about DDD.
Completely.
Do that. Have fun. Simply try and understand what problem you're solving with your software.
Go on.
Let go...
As you do this it's nice to be thinking using the same concepts you'll use to write code - that is to say, if you're going to write code in an Object-Oriented language, model in an OO way too. [See Note-1 in a few tweets.]
Don't worry, you don't need to be a UML-master.
And the old but great "UML Distilled" by @martinfowler is also very handy.
You'll also probably need rich concepts like composition and interfaces as first-class citizens.
Remember - peeps who write the code should draw sketch-diagrams, but peeps who draw sketch-diagrams *must* write code.
Either is fine. Make yourself and your colleagues happy.
Add sub-packages if you like.
Join forces with them to _really_ get your head round the difficult bits and build awesome solutions!
Ask lots of questions to get clarity and shared understanding, but never impose your words on them.
Move all these things out of your "model" package to somewhere else in your code base as soon as it is comfortable to do so.
If it makes sense to them (with a little explanation about the syntax of the language you are using) you're on the right track.
Pro Tip: Keep things legible.
Change your model. This is a breakthrough!
(Congratulate yourself on earning your first DDD Merit Badge.)
Read up on:
* Hands-On Modellers
* Ubiquitous Language
* Repository Pattern
amazon.com/Domain-Driven-…
This is 100% fine. That just means there is probably no way to do this with a single model.
If not, remove them. All models are _abstractions_ of the real world and don't need to contain everything it does.
Pro Tip: You'll probably want to go back to the whiteboard for this.
(Grrr! Frustrating!)
That's _totally_ fine. Simply go ahead and duplicate the bits you need. [See Note-2 below]
Keep both your models lean, mean and problem-solving focused.
[Note-2] Worried about not being DRY? Read this by @mathiasverraes: verraes.net/2014/08/dry-is…
The answer is "speak to your experts" again. They will likely have been thinking about two jobs when they explained things to you.
Make sure your model splits along those lines.
As they explain things going forward ask them "which hat do you have on when you're doing this?"
What is more, you've discovered the need for Bounded Contexts too.
Give yourself another DDD merit badge!
amazon.com/Domain-Driven-…