What tutorials would you recommend for learning about modular Java with OSGi, and advice on how to write decoupled systems by decomposing them into modules? What level of granularity is right; a big bundle with everything, lots of very little bundles with one specific task, or somewhere in between?
What tutorials would you recommend for learning about modular Java with OSGi, and advice
Share
I hope this doesn’t come off as sounding too trite, but I can’t think of any way to answer other than – it depends. Off the top of my head, here are some factors that would influence the answer: How big is the project? How many developers? How long will it be in use? Is it a single-shot throwaway app (say, for a demonstration), or something you need to continue to develop over a number of years? Do you want to support multiple configurations of the same base application? After releasing, do you have the opportunity to do major refactorings, or would this be impossible? Is it open source or closed source? Does the budget allow additional up-front costs (to design and develop in an appropriate modular way) for projected future benefits (not having to modularise a monolithic initial implementation)?
If you develop lots of little bundles you increase your flexibility, but at the cost of an increase in complexity. You will probably have to abstract out common interfaces into their own modules that other modules use to interact with each other. If you look at something like the Eclipse IDE, which has a lot of bundles (100+?), some of which are quite large in themselves, trying to decipher how it all fits together without some really good documentation or roadmap is like pulling teeth.
Can you provide a few more concrete details of a specific application? It might help narrow down the advice.