Expand my Community achievements bar.

SOLVED

One OSGI Bundle or Multiple OSGI Bundles

Avatar

Level 1

Hello everybody,

I wanted to run something by a larger audience in regards to AEM 6. Still new to AEM and in the initial stages of research. Currently I'm looking into how to deploy work done on components. The setup I'm running is sightly with java-use to java for component logic. From that, I want to upload everything into an OSGI bundle to my authoring server via Maven.

Now the question is, should I create an OSGI bundle for each component, containing my java and ui for the components I create? Because from a developer standpoint, it would make it easy for other developers to work on one bundle at a time without getting confused with other peoples components and files.

Also, if the bundle for each component is the route to go, how should i structure everything? Right now, I'm using the AEM archetype to create a folder for core and ui. But I know I'll need to have both an java implementation and interface for bundle to bundle communication.

Thank you for your time,

Roy

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

Hi Roy,

I don't see the real benefit in having lots of bundles, if there is no operational need to have it. If you have code, which must not be active on publish, you can put it into its own bundle. But it doesn't make sense to have 30 application bundles on each AEM instance, when all the functionality could easily fit into a single on. So the default should be "1 bundle".

Under these cirumstances I would start to have more bundles:

  • The application must be deployed onto multiple systems, and on some systems not all code must be active or deployed.
  • You have code you want to deploy to other (non-AEM) instances as well.

kind regards,
Jörg

View solution in original post

4 Replies

Avatar

Level 10

Either creating individual bundle for each component might become little over burden and difficult to maintain in terms of dependencies when we have huge list of components or having a single bundle is also not an ideal way.

Instead grouping of services based on the feature or functionality would be the best as per my knowledge !

ex: All the components and services for User management in one bundle, 

All the components and services for Article/Article detail or product/product detail in another ...

Avatar

Correct answer by
Employee Advisor

Hi Roy,

I don't see the real benefit in having lots of bundles, if there is no operational need to have it. If you have code, which must not be active on publish, you can put it into its own bundle. But it doesn't make sense to have 30 application bundles on each AEM instance, when all the functionality could easily fit into a single on. So the default should be "1 bundle".

Under these cirumstances I would start to have more bundles:

  • The application must be deployed onto multiple systems, and on some systems not all code must be active or deployed.
  • You have code you want to deploy to other (non-AEM) instances as well.

kind regards,
Jörg

Avatar

Level 1

Makes sense, a more middle option to the two ideas I had. I also made a suggestion to my peers to make a super structure for components that were related to one another. Example being Super-pom>Parent-pom->(ui-pom and core-pom) to organize everything based on functionality. 

But thanks for your input, since we are still in the planning stages, I'll run this option by my peers.

Avatar

Level 10

Sure.. Let us know your final thought !