Can OSGi help reduce complexity?

后端 未结 6 1579
傲寒
傲寒 2021-02-01 04:20

I saw lots of presentations on OSGi and i think it sounds promising for enforcing better modularization. Apparently \"hotdeployment\" and \"running different versions of x in pa

6条回答
  •  南笙
    南笙 (楼主)
    2021-02-01 04:45

    I am using OSGI for over 8 years now, and every time I dive in a non-OSGI project I get the feeling over overspeeding without a seatbelt on. OSGI makes project setup and deployment harder, and forces you to think about modularization upfront, but gives you the easy of mind of enforcing the rules at runtime. Take maven apache camel as an example. When you create a new maven project and add apache camel as a dependency, the applications seems to have all its dependencies, and you will only notice the ClassNotFoundExceptions at runtime, which is bad. When you run in an OSGI container and load the apache camel modules, the modules with unmet dependencies are not started, and you know upfront what the problem is.

    I also use the hot-deployment all the time, and update parts of my application on the fly without the need for a restart.

提交回复
热议问题