开发者

Design of utilities for diffrent versions of 3rd party library

开发者 https://www.devze.com 2023-01-26 20:10 出处:网络
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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消