I am trying to learn about OSGI. It seems it is made for creating a smart system like a smart home, IoT stuff. Is there any other use case for OSGI? OSGI for analytic platform or AI system would make sense? Sorry my question is really naive.
For me, the most important feature of OSGi is the ability to plug/unplug a code module at runtime without stopping the JVM, so the other modules (unless dependent from the plugged/unplugged one) continue to run.
Example, Liferay Portal (7.0+) is built on OSGi because it needs to add/remove features and applications at runtime without interrupting the portal itself. While, instead, if you need to add a library (even an SPI) to a Spring app, you at least have to stop it, add the dependency in the pom, compile and run again.
There are other advantages in using OSGi (modularity and encapsulation are the key points) but in my opinion this is the main one and I don't know any other java technology that does this.
Anyway, better know that OSGi is not a piece of cake. These advantages have a drawback in a steep learning curve and a lot of try-and-error. So, in my opinion, the use of OSGi should be carefully evaluated taking all into account.