RE: [GD-General] Overhead of RTTI
Brought to you by:
vexxed72
From: Nicolas R. <nic...@fr...> - 2002-12-24 14:30:52
|
Hi, > > And, as a general rule, multiple inheritance is evil and should be > > avoided. > > Whoa! Talk about an overblown general statement! > > I would say that multiple inheritance definitely has its > place, in particular inheritance of abstract interfaces. > Do not mix object inheritance, and interface expension / implementation. Though those are completely mixed (for evil sake) in C++, one must pay attention to be absolutely clear on how they are used. Objects should inherit at most ONE object, and implement as many interfaces as needed. Interfaces should expend at most ONE interface. A lot of inheritance problems we got in the past were due to a misunderstanding of those statements. On the RTTI subject, I really like to have all objects (and I say objects) implementing a RTTI scheme of our own, and providing interface access methods. Interfaces do need some kind of static identification, but usually RTTI is not needed at that point. Nicolas Romantzoff. |