开发者

How work with common utils project

For example, I have some project Common.Utils.csproj and use it in all other projects. I can store its (Utils) sourses in one repository, modify it only ther开发者_JAVA技巧e, register dll in gac and use it as dll in other projects, or I can clone sourse anywhere I need, include project in solution, use it as source and push modifications. So, what is best practice?


I would recomend having it in a single place and have your other projects reference this, so that all changes will be available, without having to update all copies.

The only problem you might face is if you change the signiture significantly, which might break the backwards compatibility, but you should try to code for that.

But this should not be a major issue if you make use of test cases for your common methods, to ensure that previously used methods are still working correctly.


Avoid util libraries at all cost. They are a code smell that indicates violation of a lot of SOLID principles; first and foremost the Single Responsibility Principle.

Ayende explains it very well here.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜