A plug-in system, in it the core usually consists of two things.
1) The interface or set of interfaces that the plugin must implement in order for the underlying system to use them.
2) A custom class loader, which the main system implements to load plug-ins, which are usually packaged as banks.
The main system creates a class loader based on some predefined directory or configuration file that indicates where the plugins exist. This loader iterates through the classes and finds those that implement the specified interface, and calls methods based on this interface, depending on the system.
source share