Have you ever heard about Domain-Driven Design or Event Sourcing and you want to get familiar with those exciting techniques?
TL; DR
You can find the map of my developer journey (with DDD & Event Sourcing resources) below:
MIRO BOARD LINK - Developer Journey Map - DDD & Event Sourcing
Every single time
But the problem is the same as always. When your journey with programming just began you were probably asking: Where to learn? What should I learn? What should I do at first? How long may it takes to be hired? What are best practices?
The story repeats with new things to learn. Where to find resources? In which order should I watch them (like Star Wars movies)?
Prepare own learning path is not so easy. So, I've done it for you, young Padawan!
3 years of exploration in one place
I've been learning those concepts for about 3 years. Almost every day I read new posts / books etc. related to those topics. I've fallen in love with DDD and ES just when I've heard about them from the best lecturer on my university.
I believe those techniques may prevent a lot of bad decisions and save your software projects. DDD is not only about coding patterns, the most important part (strategic patterns) are about searching solution for business problems (solution may be a piece of software, but is not required).
What? Your CODE is evolving!
But the readable code is a side effect of good design decision in the spirit of DDD. Below you can see how my coding style of domain model evolves with those techniques in mind.
BEFORE
fun changeMaximumRetention(maxRetention: Int): DataRetention {
if(isValidRetention(maxRetention)){
throw new InvalidRetentionException(maxRetention);
}
if(this.deletionIsPaused){
return DataRetention(this.id, maxRetentionDays, this.days, this.deletionIsPaused, this.pauseReason)
}
return DataRetention(this.id, maxRetentionDays, this.days, true, "Paused due to maximum data retention update")
}
Do not stop so long on this piece of code... Let's move to the next one.
AFTER
fun changeMaximumRetention(maxRetention: RetentionDays)
: List<DomainEvent> {
val maximumRetentionWasChanged = MaximumRetentionWasChanged
.event(maxRetentionDays);
val deletionWasPaused = DeletionWasPaused
.event("Paused due to maximum data retention update");
return if(this.deletionIsPaused)
listOf(maximumRetentionWasChanged)
else
listOf(maximumRetentionWasChanged, deletionWasPaused)
}
Reasoning about this code is so simple right now, even if you don't know the domain. I hope that you see what are the business rules here:
- Given data deletion is paused, when change maximum retention, then maximum retention should be changed to new value.
- Given data deletion is not paused, when change maximum retention, then maximum retention should be changed to new value and data deletion should be paused.
Developer Journey Map
I've prepared Miro Board with a mind map which will guide you. You can find where to start your own developer journey today! There is a lot of Domain-Driven Design & Event Sourcing resources to discover. There are also sample projects which I recommend to watch. I hope, that following my footsteps will make you a better developer day by day.
Let's grab the map below!
MIRO BOARD LINK - Developer Journey Map - DDD & Event Sourcing
I'm sure that those resources will give you a strong theoretical background and will be a compass on your way to practice and mastery.
Let's begin your own journey and catch'em all!
This is the way
Are you already on the way?
Maybe do you recommend some other resources which I should place on the map? Or have you already learn something from them? Please let me know in the comments :)
I will be updating the map which new discoveries, so be sure to return here from time to time.
π§ I encourage you to join my mailing list. Here you will find more content like this and also have opportunity to learn with me :)
Top comments (0)