I've inherited a project where such solution is applied:
There are 5 versions of 3rd party library. And there 5 projects in the solution with utilities for corresponding version of 3rd party library.
Quite a lot of utility classes in the solution have identical code for all versions of 3rd party library. The duplication problem is solved in such way - the code files 开发者_开发百科that need to be the same for all projects are stored in some common folder and added as a link to all projects.
I do not feel that using links to share code is the best approach. Could you tell me if it is a bad approach and if it is so, please tell me what is the right way to .resolve such code duplication?
Thanks in advance.
It's fairly subjective as to whether this is 'bad'.
Linked code files are possible for a reason - sometimes it is necessary to share files like this between multiple projects.
Depending on how different the third party library is between versions - it might be possible to write some wrapper code which deals with these differences and isolates this away.
精彩评论