开发者

Should I put global application details in a static class?

开发者 https://www.devze.com 2022-12-21 11:21 出处:网络
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:

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

精彩评论

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