|
From: Jose' C. <cru...@ce...> - 2004-11-29 22:42:07
|
Il giorno 29/nov/04, alle 19:53, James W. Walker ha scritto: > Peter Michelsen <Pet...@mi...> wrote: > >> But as a straw pole are we in favor of a real C++ implementation >> using inheritance, virtual methods but with no exceptions to replace >> the current C based E3 files. Yes or No. > > If I had to say just Yes or No on that, I guess I'd have to say No. I > think it might be better to use exceptions (and constructors and > destructors) than to use inheritance and virtual methods. As I said > in another message, you can't really use STL without using exceptions > to some degree. > > I'd like to hear more about how you envision using inheritance and > virtual methods. It's not clear to me how we could use inheritance > for the Quesa object hierarchy without losing the ability to extend it > with plugins, but maybe that's not what you had in mind. > -- Given that the external API doesn't change... I've to second James on this, and my proposal is: + C++, I think averybody agree + few STL and few exceptions, containers, iterators and functors when it makes sense, not to templatize everyting, exceptions inside Quesa + inheritance yes the class hierarchy is best described by inheritance, BUT no virtuals functions to implement the API, instead I'll make an array of function pointers in the class with a slot for every kind of api function ( a shortcut to the metahandler) and a hashtable to plugin methods so instance.tablePtr = &class.functionArray[]; instance.hashtablePtr = &class.hashtable; the functionArray is initialized by the class constructor, so it's overriden while the class object is constructed creating the virtual methods with a custom method table, allows the creation with plug-ins via the plug-in metahandler this way allows us also a mild transition. create the C++ base classes and derive the others via the metahandler, when things works, begin changing the implementation of derived classes in C++. Pax et Bonum # dott. Jose' Cruanyes Aguilar - C.E. Soft srl # Pzza. Firenze,4 MILANO - XX Settembre 10, CREMONA # 02,33603122 0372,460602 |