My definition of a module is an encapsulation unit (i.e. hides internal details) that communicates with other modules through a contract (i.e. a predefined set of possible interactions). The JAR file is not a module because it does not have any of these properties. There is no encapsulation, all internal implementation details are visible and accessible from the outside. There is no contract, you just put the JAR file in the classpath and hope that it will provide you with the necessary functions.
Dynamic means that OSGi packages (modules) can be installed, updated, or uninstalled at runtime. This can be very useful for updating running systems or for efficiently deploying software on a large network.
Communications must be established because the software must always be installed before using it. JAR files must also be installed! Only the installation tools are slightly different from each other, that is, JAR files are added to the class path, while packages are installed using the install command (this can also be written or called from the API). OSGi gives us much more control over this process.
source share