Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it appropriate to use OSGI framework on small java app?

Tags:

java

osgi

I have a plan to reimplement one of my small but usefull applications with OSGI framework. I never used it, so I ask is it appropriate to use OSGI on small app and is it a big difference in speed or/and memory footprint when using such framework. Also if it is a good option I would ask what implementation is best for small applications.

thank you!

like image 397
danizmax Avatar asked Dec 13 '22 12:12

danizmax


1 Answers

For modern computer systems, speed and memory footprint of OSGi are of no concern at all: remember that OSGi was developed for resource-constrained devices. The memory footprint is in the hundreds of kBs, and once the service resolution is done, the framework has no impact on the speed of your application (for instance, there are no proxies). In short, no worries at runtime.

I like the way a properly designed OSGi application cleans up the application's structure, by forcing you to think about your modules and services. I will stay away from all the benefits of modularization and service orientation here, just remember they apply just as well to small applications as to large. Hey, you might even start to find reusable components!

You will need to think about packaging and shipping your application: depending on your audience, you can get away with just shipping a bunch of bundles, using a shell script to get the system going (using e.g. Pax Runner), or you might need to invest in something a little more fancy, like nice application packaging with an icon.

like image 98
Angelo van der Sijpt Avatar answered Dec 15 '22 01:12

Angelo van der Sijpt