Article Directory
Pre
Plug-in - a configuration, only one step away from the plug-in mechanism Is there any dependency in it, I don't want to depend on it, what should I do?
plan
- Application A defines the service interface, and agrees on the functional specification implemented by the plug-in.
- Applications B, C, D, etc. implement the interface respectively, and package them into jar packages, and place them in the reading directory agreed by application A.
- When application A is running, it reads the jar package in this directory, and loads the implementation class in the jar package through reflection.
- Application A calls the method of the implementation class to complete the respective function extensions.