问题描述
我有,它利用许多全球性常数的项目。最后,我计划中提取程序的某些部分,并创建自己的组件。
I have a project which utilizes many global constants. Eventually I am planning to extract some parts of the program and create assemblies of its own.
它是有价值的(或者是这可能吗?)单独(即,GlobalConstants.dll)创建全局常量的组件,这样我就可以在未来会议使用这个组件?
Is it worthy (or is it possible?) to create an assembly for global constants alone (viz, GlobalConstants.dll), so that I can use this assembly in future assemblies?
此方法会帮我做的少的编码,我可以保持相同的名称在整个项目中的常量。
This method will help me do less coding, and I can keep the same name for the constants across the projects.
推荐答案
在多少个项目,你期望的相同的常量是有用的?如果有真正它的情况下,再细;否则......不知道。
On how many projects do you expect the same constants to be useful? If there is genuinely a case for it, then fine; otherwise... don't.
当然,如果你有一些的同样可能被重用的程序库,那么他们可能是有意义在那里,只要适当地命名空间和类型的范围。
Of course, if you have some equally likely to be reused utility library, then they might make sense in there, as long as appropriately scoped by namespace and type.
个人,直到我有一个的的实际,具体的的目的,移动它们,我要离开他们独自。
Personally, until I had an actual, concrete purpose in moving them, I'd leave them alone.
这篇关于移动常数到一个单独的组件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!