Our code is in Java and Javascript (AJAX libraries). We have wrappers/reusable code around the existing libraries to perform mundane tasks like, db connections, session management, logging, hibernate settings, base structure, some reusable multitenancy code etc.. From the javascript end, we have page initializers, UI layout components, custom js objects, and some of our own logic.
We have multiple projects where this code can be reused, but at the same time, this code is evolving along with the application. So if we find a common way to do it, we can move it to the framework code and let other projects also benefit out of it. If/when we find a bug in the base code, we can fix it in one place and commit and all the other projects will pick up the change (rather than everyone making the changes locally).
If it's just java files, we can keep it as a separate project, and include it as a dependent module in eclipse/maven and have it included as a jar, as and when needed. This part is easy to handle, but now we also have reusable javascript in the code, which cannot exactly be jar(ed). We want some suggestions on how the code should be laid out, so we can reuse it via maven (deployment time) and via eclipse (development time), without going thru too many hoops.
Before writing this, I did come across some articles on stackoverflow, which do talk about reusable code and methodologies which are great, but not exactly how to manage them using svn, maven, eclipse etc..
Linking them, for reference.
- http://stackoverflow.com/questions/1082488/architecture-of-some-reusable-code
- http://stackoverflow.com/questions/268258/how-do-you-make-code-reusable -> This is a great article from a theory stand point, but no tips on management.
- http://stackoverflow.com/questions/237946/how-do-i-index-and-make-available-reusable-code
In some of our old projects, we maintained ant files, which would copy files from base locations to the final war, so everything is available. But over the period of time as the project grew, even for a simple check, we had to rebuild the whole war and deploy to test on the developers machine. Which took away 5 minutes every time.
So the question is, are there any repository patterns, eclipse project layout ideas, packaging styles, which can help us resolve this issue ?