These days, in order to design the plug-in development framework, I tried to think about the problem with divergent thinking. I have seen dependency injection, AOP (Aspect-Oriented Programming), and contractual design in the middle. Although some tools cannot be used directly, these ideas can be used for reference, such as dependency injection and contractual design. As for AOP, it is highly correlated with tools. Although it is a good idea, it cannot be used directly in C ++.
The dependencies between plug-ins I designed are not implemented through interfaces, but through data (cell streams) between plug-ins ). Cell flow detection can be performed using contracts.
Overall structure of the plug-in development framework
Microkernel:
1. Loading, detecting, and initializing plug-ins.
2. register the service.
3. Calls services.
4. Service Management.
Extension layer:
1. Log printing.
2. The message (cell stream) is interpreted as text in binary format. Easy to locate.
3. Tracing of messages and logs.
Distributed Processing Layer:
1. It is used to communicate with other frameworks.
2. Works with other frameworks to form a distributed system.
Automated Testing Framework layer:
1. Integrate cppunit.
2. Automated integration testing framework.
3. Automated functional testing framework.
Integration layer with third-party frameworks:
1. integration layer with third-party frameworks.