开发者

Should I put global application details in a static class?

I'm currently maintaining a legacy C++ application which has put all the global application details in a static class, some of the variables stored are:

What is the recommended method for storing and accessing system application details?


If it never changes then why not. However, if not I'd externalise it into data that's loaded at run time. This way it can change without rebuild.

And since you include version number, I'd suspect the latter is way to go.

From my C++ days I recall builds taking not inconsequential times.


I'd rather use a namespace if no instances of the class will be created.


no hurt, and I think to use a singleton is even better.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜