In the company where I work we have a mix of common library base (several C++, C++/Cli and C# dll's) which grow big over the years. We are planning to refactor it, therefore I'm trying to learn the best practices how to do it. Most of the new design is clear for me, however I'm not sure how to deal correctly with 3rd party dependent code.
At this moment the library is dependent upon different technologies like OpenCV, OPC, MySQL, MSSQL, AVT Vimba, Ximea Api, Microsoft Enterprise Libraries, .Net framework, TwinCat, Dave, Cuda, ...
One of my biggest problem with the current design is that in most of the cases when I have to use only few functions from the common libraries, I end up with an exe file, 2-3 common libraries and 30-50 3rd party libraries. At this moment the code is divided across the libraries based on their domain, which is not really good, because it forces me to release my application with libraries which the application don't really need.
So, how do you guys avoid this kind of hard dependencies on 3rd party libraries?
Is it a good idea to divide the code based on domain and also technology? Lets say the Cameras.dll is dependent upon AVT Vimba, Ximea and OpenCV. My idea was to divide it this way:
- Cameras.dll -> no dependency on 3rd party libs
- Cameras.Avt.dll -> dependency on AVT
- Cameras.Ximea.dll -> dependency on Ximea
- Cameras.OpenCV.dll -> dependency on OpenCV
Aucun commentaire:
Enregistrer un commentaire