When I first started learning OSGi, I got the impression that you can just create a JAR and, since it has a manifest file, you can deploy it in an OSGi container. I suggested that I build my modules in the classical way (maven) and maybe use some kind of plugin or something like that to write the manifest, I could have my module, which would basically be a stand-alone application, exchanging with other modules through OSGi.
As I read more about OSGi, I’m starting to see more examples of how it is used on a lower level and basically replacing dependency injection and providing end-to-end services such as logging. And it seems that using things like hibernate or others is a problem ... (or maybe I just missed something).
At least for me, I really don’t see the point of having such a subtle level of modularity and integration in OSGi, I would prefer to have separate modules, each of which has its own set of technologies and framework, and, possibly, web resources and level of conservation . Is this possible with OSGi? If so, can you point me in the right direction, examples, etc.?
edit , added a few details about how I'm trying to use OSGi:
I just foresee the possibility of having a module of more than one class, which may have a higher level of responsibility.
How to say an agenda module. In this case, I want to have things like saving events, adding events, a list of events with filters, etc ... This agenda may have several inner classes, and even a level of persistence may be required. Therefore, I would like to use something like Guice for these classes, and some JPAs to save my data.
I understand that some problems associated with the X-environment, such as the server or registration, may have a set, but the data model is specific to the package of questions. So, I think my question was at the end. What and what cannot be done inside the package? And what should and should not be done internally, as a general practice?
Thank! Mauricio