When to use OSGI Bundles and when not to use them?
I understand how to create an OSGI bundle using the Maven
- mvn -Padobe-public archetype:generate -DarchetypeRepository=http://repo.adobe.com/nexus/content/groups/public/ -DarchetypeGroupId=com.day.jcr.vault -DarchetypeArtifactId=multimodule-content-package-archetype -DarchetypeVersion=1.0.2.
I understand the technical tasks required to make a bundle and in eclipse and import it into AEM.
On the site i am working on I have been given 3 points of view for using OSGI Bundles in Components.
1) (Also my preference). Place as little code as possible inside JSP files, place all Java class code inside OSGI Bundle in eclipse and then import bundles into AEM.
2) Bundles are kept simple, with as little as possible “data” in them. Authors are empowered to configure as much as possible from the component dialog with the bundle simply doing the “heavy lifting”.
3) Avoid bundles, if and get the JSP to do processing, including placing classes in the JSP. While this can be made to work I can foresee problems in the future.This idea proposed was that the web site would consist of series of cards, each card holder just being a place for the Author's to drop components into. Each component would be a self sufficient module, with all java code existing in its jsp files.
So my question is, is what is the best strategy for optimizing use of bundles (as in view 2).