This question may have been asked before and if so feel free to link to the answer. I'm looking for a modern and effective recipe for a common problem. I have a project with a main module, A, that depends on another module, B, that I develop separately. this module has 2-3 (C-E) other modules it depends on, each of which belong to me as well. Some feel comfortable locating all modules in one svn or Git repo. My experience and gut tell me each module belongs in and individual repo. I currently face this dilemma with a NodeJS/Electron project I'm working on but the problem/solution is certainly technology agnostic. While I don't know enough about local modules in node I am more than familiar with the concepts. I'm just struggling on how to best apply what I've learned to this project I'm currently on.
I'm going to iterate the pros and cons of both approaches below as I've seen from my 17+ years of experience. I'm interested in how others have addressed this issue and is totally separate modules the way to go in this day and age? Are there any new tricks to managing local dependencies that I've missed over the years?
All in one repo
- Everything can be compiled/debugged easily as one complete program in the classic way of thinking.
- Changes made in the individual modules are immediately visible and represented when launching the main module. Everything is "linked" together.
- Lower barrier to entry for junior-mid level engineers.
- Project cohesion suffers as boundary lines of responsibilities blur. (Too easy to link code from defendants to dependencies & vice-versa.)
- Slower more complicated builds as additional logic must be factored in to deal with compiling each module in the proper order and in the proper way.
- Better cohesion. Lines of responsibility are clearly delineated
- Instant/immediate re-usability. (In order to prove the module works you must test it outside of its dependent module which enforces reusability from inception.)
- Smaller simpler manageable builds. The dependencies are built once per release and the main project only needs to declare its dependencies rather than build each of them.
- Additional complexity iterating changes in the module dependencies. A dependency must be built & released (or semi-released) before being run in the main module.
- Add'l complexities in debugging. You can't always step into the dependency source with this approach depending on the technology stack and approach of assembling the overall app.
- Requires more discipline, higher barrier to entry for junior-mid level engineers.