M
maverik
Hi all.
I'm writting some kind of text processing application (in C++). It has
about 20 classes. Of course, it also has some settings (such as text
color, text size, text family, etc). This settings is represented as
class with static members, like this:
Settings.h
class Settings {
...
static std::string TextFamily;
static int TextSize;
static std::string TextColor;
... // Many other options (about 100)
};
So, other classes use this class:
MyAnotherClass.cpp
voif foo() {
if(Settings.TextSize == 12) { ... }
...
};
My questions:
Is this bad design?
What advantages or disadvantages it has?
Can you suggest me how to organize settings in better way?
Thanks.
I'm writting some kind of text processing application (in C++). It has
about 20 classes. Of course, it also has some settings (such as text
color, text size, text family, etc). This settings is represented as
class with static members, like this:
Settings.h
class Settings {
...
static std::string TextFamily;
static int TextSize;
static std::string TextColor;
... // Many other options (about 100)
};
So, other classes use this class:
MyAnotherClass.cpp
voif foo() {
if(Settings.TextSize == 12) { ... }
...
};
My questions:
Is this bad design?
What advantages or disadvantages it has?
Can you suggest me how to organize settings in better way?
Thanks.