As an application grows the need to segregate functions and code grows as well. It becomes more and more reasonable to maintain related features together and separately, and allow for extensibility.
For example we need to add a Human Resource functionality to our application without affecting core functionality and allowing it to be an optional feature depending on the client.This become rather cumbersome without a ‘plugin’ system in place.
This is my new quest, but first is there really a difference between modules and plugins. Wikipedia places them at relatively close quarters: Plugin -> (of a module or software) able to be added to a system to give extra features or functions. Module ->any of a number of distinct but interrelated units from which a program may be built up or into which a complex activity may be analyzed. This names have been used interchangeably in various platforms so I guess its just a matter of naming
There are various ways achieve this some being very complex through to the very simple and limited. One would really need to look into each approach on its own and at least do a Proof of Concept where applicable before deciding whats best for their case. I will just highlight them then delve into each later.
- OSGI (Open Service Gateway Initiative), most recommended, ‘heavy’
- JSPF (Java Simple Plugin Framework). 5 minutes and it works. No XML. ‘Maybe dead’
- Apache Felix, a community effort to implement the OSGi Framework and Service platform and other interesting OSGi-related technologies under the Apache license.
- Custom using Grail like class loading and jar/war extraction.