We continue our Domain Driven Design conversation this week as Allen is indecisive, Michael decides for him, and Joe can’t handle the night life.
Using your podcast player to read these notes? Head to https://www.codingblocks.net/episode60 to see the full show notes in all of their glory.
Do You Even Slack?
If you don’t, you should. Head over to https://www.codingblocks.net/slack to be a part of the conversation.
This week we want to know: What is your headphone style of choice while coding?
- Lots of love and thanks to everyone that left a review. We greatly appreciate it.
- iTunes reviews: ELiktman?ELichtman?’sThat it?, Andreas Risberg, ChrisB777, martinrocket, Hegele, Ashy Lary, TSouza1985, Ilcawthorne, Basicallysteve
- Stitcher reviews: We’ll never know since Stitcher was down at the time of this recording. However, we will be sure to include those in the next episode.
- Allen can’t decide which laptop to buy. So he bought both.
- Microsoft has the largest Git repo on the planet.
- Why Google Stores Billions of Lines of Code in a Single Repository. (watch via YouTube, read the article at ACM)
- Should we have a National Code Forgiveness Day?
- Kinda like https://emaildebtforgiveness.me/, but for code.
- Quick and Dirty.
- Should you do it?
- Is it wrong?
Coding Blocks Gear
You need some Coding Blocks stickers in your life. And maybe a shirt. Check out https://www.codingblocks.net/swag to get yours.
The Domain in Domain Driven Design
- Try not to use anemic domain models, which focus on state rather than behavior
- Do use rich domain models – these focus on behavior, not just the state
- Should represent concepts of the business
- Should contain information about the business situation
- Contains business rules
- Technical details of storing these things are delegated to the infrasturcture layer….NOT HERE
- Behaviors are king – “what can you DO” – not what attributes are saved
- An object that’s not just a bundle of values – must live on – has an identity and are mutable
- Associating entities – if you can get by with single direction associations, you will GREATLY simplify your life
- Start with single way associations
- Shouldn’t have an equals operator?
- Measure, quantify or describe a thing in the domain
- It’s identity is the composition of it’s values – does not carry an identity field
- Compared using a combination of all its values
- Can’t have side effects
- Money is a great value object. 100,000 means nothing without a unit – prime candidate for a value object
- You should strive to use value objects wherever possible rather than entities
- A time range, as described in the Pluralsight course is a great example as well – a start and an end date – and those may have additional methods
- Important operations that don’t belong to a particular Entity or Value Object
- Have interfaces defined in terms of other domain model elements
- Stateless (but may have side effects)
- Exist in the core of the app
- A domain service would be responsible for things like processing a payment
Resources We Like
- Domain-Driven Design Fundamentals by Julie Lerman and Steve Smith (available at Pluralsight)
- Modern Software Architecture: Domain Models, CQRS, and Event Sourcing by Dino Esposito (available at Pluralsight)
- Domain Driven Design – Tackling Complexity in the Heart of Software by Eric Evans (available at Amazon)
Tip of the Week
- Want help on your side project? Make it easy for others to help:
- Put your code on GitHub.
- Create a README with instructions on how to build and run the project.
- If it’s trivial, then it will be trivial to document.
- Create an issue describing the issue as “help wanted”
- Assign the issue to Joe. /8)
- Think you know PowerShell? Check out how Mike F Robbins gets our feed.
- Remarkable – Markdown parser, done right (available on GitHub).
- Format your JSON with ease:
Spread the Word
Do you know how you can help us? Tell someone about the show. That’s it. It’s that easy. And, we’d appreciate it. Super appreciate it.
And if you haven’t already, head to https://www.codingblocks.net/review to leave us a review. The world needs to hear your opinion.