I designed a GUI that could do that and more, and the most RTTI it used was a factory, where allocators were keyed to strings containing the class names, which were generated at run-time by typeid(). Lack of foresight, indeed. Try virtual functions:
class window
{
public:
virtual void configure()
{
// bring up dialog box for data members
}
};
class edit_control : public window
{
public:
virtual void configure()
{
// bring up dialog box for data members
// must also process base''s data members
}
};
GUI hierarchies should be shallow, so this isn''t bad. And it allows derived classes the flexibility to hide base class traits that make absolutely no sense in the derivation and/or to build a different interface to certain base class traits.