My Library includes an interface (representing the camera) and some derivative classes.
factory I have supplied that, in which there is a method:
ICMAARA * (Const Strude :: String and Type) Factory # All Derivatives Includes and links sections, and library users do not know about the proof of derivative . Create () has been explicitly implemented: if (type == "A") return the new camera (); Return
if (type == "b") new camera ()
... So basically there is a bloated factory. The lib includes all the necessary dependencies, and the library can connect to the factory and make any camera. Lib
Question - When you link to Factory.Lib, you will be able to access all DLLs from all vendors while running your application. Is needed. Ideally I want you to be able to use DLL only for specific cameras. Is there any way to get it?
- I'm not thinking of deriving each DLL form, now the factory. The lib is not bloated, and all the camera specific dependencies are in each derived DLL. If I do not resolve
li # 1, then it does not help much, because you will need all the derivative DLLs except the factory.lib and vendor DLL. - Is there a better way of implementing the manufacturer class (or method)? My derivative classes are limited numbers, 5-6, and often do not grow.
- Any other tips for reducing dependency and improving the design are welcome
You can load shared library (or DLL) at runtime. You will need to find out where (in the DLL) to see the implementation of specific ICAMA. For example, you can export the second function of each DLL, which actually provides information, what types of implementations (type == "A" and type == "C") are provided by a specific DLL. Upon launching the application, it can search for DLS and call the information interface for each DLL.
Comments
Post a Comment