DEV Community

5 ways to make your codebase withstand the test of time

Lorenzo Arribas on October 18, 2018

This is the first in a series of articles where @hecrj and I share what we have learned after working on a large, fast-changing codebase for the p...
Collapse
 
squgeim profile image
Shreya Dahal

Awesome writeup. The common issue with separating codebade by domain I've seen is that often the domains in an application are not so clearly defined. There is always some confusion regarding to where something fits, especially if there are any inter-domain features; and something that makes sense to one does not make sense to another. This makes finding the whole picture of a feature difficult sometimes.

Collapse
 
larribas profile image
Lorenzo Arribas

Yeah, I completely agree. I mean, there are whole books on the topic! (one I enjoyed a lot was oreilly.com/library/view/implement..., which goes quite in-depth into bounded contexts).

In the project that inspired this article we decided to create the most granular domains we could (f.i. Question, Answer and Comment were each a totally isolated "microservice"). This has been quite effective, but I couldn't claim that it's the right fit for all codebases.

Collapse
 
squgeim profile image
Shreya Dahal

That book looks interesting. How are you handling inter-domain communication?

Thread Thread
 
larribas profile image
Lorenzo Arribas

In our case, we have a combination of synchronous RPC calls (where one domain can call another) and asynchronous event listeners (one domain can react to what happens around it).