Reasoning behind usage of Eclipse IDE in combination with OSGI bundles


For my research project at Avans University I have to find out why openEMS makes use of the Eclipse IDE in combination with OSGi-bundles. Is there anyone that could tell me the reasoning and strategy behind this.

Thank you

Dear Arshiya,

Thanks for getting in touch. The decisions can be broken down like this:

  1. Choice of Java as programming language
    Java was chosen, because it is a widely used, type safe programming language. Compared to alternatives like C or C++ it has some downsides in hard realtime applications, which are per definition outside of the scope of OpenEMS (we consider realtime tasks to be executed on a different system level, like e.g. on a battery management system or the firmware of an inverter.). Compared to alternatives like Python or JavaScript/NodeJS, Java has the benefit of being type safe.

  2. Choice of the OSGi module system
    As being the most advanced framework for modular systems in Java, OSGi was a natural choice:

  • An energy system is frequently composed of different hardware devices and different control algorithms have to be applied. This fits well with OSGi bundles that allow a system to be tailored with exactly the drivers and algorithms required.
  • Physical hardware is different, but often they are of the same ‘type’, e.g. a Meter or an Electric Vehicle Charging Station. In OpenEMS we call this a ‘Nature’ and it fits well with the service and provider architecture in OSGi.
  • OpenEMS code base is huge (about 500.000 lines of code) and many developers are working on it. The strict separation of interface and implementation in OSGi helped to keep a clean and structured code base, avoiding spaghetti code
  • Choosing OSGi for OpenEMS was heavily inspired by Eclipse SmartHome / OpenHAB, which already used OSGi before successfully.
  1. Choice of the Eclipse IDE
    While it is definitely possible to develop Java/OSGi applications in any other IDE (a minority of OpenEMS developers uses IntelliJ IDEA), OSGi is just best supported in Eclipse IDE together with bndtools.

Hope this helps.


(btw: I realized a colleague of yours also contacted the OpenEMS Association chair. For community questions we usually prefer to answer them here in the OpenEMS Community forum, as it also serves as a documentation for future readers. If you use OpenEMS at University, please consider becoming a member of the OpenEMS Association (it’s free for universities) and use our Zenodo-ID for publications)

1 Like