将多个项目共享的“实用程序”类转储到单个实用程序库中,或者创建许多小程序集,每个程序集都必须由使用它们的项目加载,这是一个更好的主意吗?
我不太喜欢实用程序库的想法,而且您会得到完全混杂的功能,但另一方面,拥有 20 个 dll,每个 dll 都包含一个功能似乎也不是一个很好的解决方案。
还有第三条路吗?
编辑:
这是使用.net
Is it a better idea to dump 'utility' classes that are shared by multiple projects into a single utilities library, or to create many small assemblies each of which has to be loaded by the projects that use them?
I don't really like the idea of utility libraries, and you get a total mish-mash of functionality, but on the other hand having 20 dlls which each contain a single piece of functionality doesn't seem like a great solution either.
Is there a third way?
EDIT:
This is using .net
发布评论
评论(3)
我倾向于将实用程序放入一个(或几个)较大的程序集中,但使用命名空间以获得它们之间的清晰结构。
I tend to put utilities into one (or a few) bigger assemblies, but work with namespaces to get a clear structure among them.
取决于您希望如何将工作分配给开发人员。 这还取决于您以后是否想重用某些类。 而且 - 如果您有一个实用程序类在整个应用程序的一个点中使用 - 这不再是实用程序类......
Depends how you will want to have your work distributed to your developers. It also depends if you want to reuse some of the classes later. And – if you have an utility class that is used in one single point in whole application – this is no longer utility class…
我会选择一个带有命名空间的程序集。
当包含在许多项目中时,要警惕实用程序库中包含的内容。
否则您将遇到 类似这样的。
I would go with one assembly, with namespaces.
Be vigilant about what goes into the utilities library when including in a lot of projects.
Else you will be confronted with something like this.