Choosing between Impala and OSGi

I studied OSGi for my software for the company, but recently it was recommended to take a look at Impala. According to his web page, Impala is "a dynamic module platform for Java-based web applications based on the Spring Framework."

At first glance and looking at this blog post about the differences, I can see that Impala is easier than OSGi to not control versioning of third-party components and is much less widely used / known (I don't see a single question about this in Stack Overflow).

I wonder if people who have direct experience with Impala and OSGi (i.e. those who have studied it more deeply than reading blog posts and online documents) have a deeper understanding of the practical differences between them and / or suggestions regarding what types of projects may be more or less suitable for.

Edit: It may also be interesting to include Springsource Slices in the comparison, although this is still an early prototype. At first glance, it only works on the DM server.

+4
source share
2 answers

Impala's approach to modularity is very weak when it comes to controlled module sharing. The problem is that Impala still follows the old hierarchical J2EE style approach to loading classes.

Anyone can write a modular system that limits the visibility of classes through modules. The hard part is how you re-enter dependencies between modules so that other classes and interfaces from one module can see another module. At OSGi, we do this by exporting and importing packages, so we have a non-hierarchical dependency graph.

In Impala, if you want to see classes in another module, your module must be a descendant or descendant of this module. That is, only their own classes and their ancestors can see modules. Now, if you want to share some classes with your sibling module (for example, with the library you use), you must move this library to the class path of your common ancestor. In the worst case, you need to move it directly to the root module. Now the library is visible to ALL other modules, regardless of whether they want it or not! Indeed, if another module wanted to use a different version of the library, they would be forbidden to do this.

If you simply have a copy of the library in every place where it is used, then you cannot use modules using this library to communicate with each other. They will receive ClassCastExceptions when they try to pass objects to each other.

A similar problem is inherent in J2EE if two web applications need to use the same library. Typically, J2EE developers simply copy the library, but this creates “silo” applications that cannot communicate with each other. This is simply not the way to create modular software.

Stephen's glasses also seem appropriate. As far as I can tell, nobody uses Impala aside from their author.

+10
source

There is no comparison in my eyes. OSGi is a mature framework that has been around for 10 years and is the foundation for most of today's Java containers. OSGi is growing, there are books, and, yes, people talk about it on Stack Overflow!

Impala did not even get into a stable release and seems to be a project of 1 person, although now it is asking for additional developers.

So it depends on your criteria. If you are learning technology out of interest, I don't see any problems with Impala. If you want future products of your company to be based on it, I think it will be professionally careless.

+6
source

All Articles