The development team I’m a part of wrote and still maintains a codebase of pure Java spaghetti code. Most of this was implemented before I joined this team.
My background is in Python/Django development and the Django community really emphasizes “pluggability” — a feature of Django “apps” (modules) which implies mostly “one thing and one thing well”, re-useability, loose coupling, and a clean, conscious API. Once the Django team I once worked in started to “get it”, we pretty much had zero problems with messy, tightly-coupled masses of monolithic code.
Our practice involved developing Django apps outside of the Django project in which we intended to use the app (a common practice among Django developers, from what I’ve gathered) Each even lived in a Git repository separate from that of the overall Django project.
Now, we’re presented with an opportunity to refactor much of our spaghetti code, and it seems to me that some of what I learned from the Django community should be applied here. In short, I’d like to see our new codebase developed as a series of “pluggable” modules each written under the assumption that it won’t have access to other modules (except those on which it should rationally depend). I believe this should do a good job of driving home principles of proper software design to the whole team.
So, what I’m advocating for is to have one separate repository per “feature” we want in our new (Spring) project. Each would have its own, independent build process and the result would be a .jar . We’d also have a repository for project-level things (JSP’s, static files, etc) and its build process would produce a .war . The .jars wouldn’t be placed inside the .war, but rather be treated as Gradle dependencies (the same way third-party dependencies would be.)
Now I have to sell it to the boss. He’s asked for some example of precedent for this plan. Obvious places to look would be open-source projects, but if a project is split across multiple repositories, it’s likely to be multiple projects. So, perhaps I’m looking for some sort of suite. Spring itself looks promising as an example, but I haven’t been able to find many others.
My questions are (and sorry for the long back-story):
- Is there any such precedent?
- What examples are there?
- Is there any documentation (even just a blog post would be of help) out there advocating anything like this?
- Any suggestions for implementing this?
- Is this even a good idea?
Thanks in advance!
Edit: Whether or not to refactor is not in question. We have already decided to make some drastic changes to most of our code — not primarily for the purpose of “making it cleaner” in fact. My question is about whether our planned project structure is sound and how to justify it to the decision-makers.