From: SF M. E. <el...@us...> - 2004-03-21 00:41:30
|
I try my next suggestions to see if they can be accepted for code improvements. 1. I see the following in the file "mop.h". // these must be consistent with ... in token.h enum { Public = 298, ... , Undefined = 0 }; I suggest to use C++ to enforce this constraint. The values should be taken from the enumeration in the other header by their symbolic names. 2. How do you think about to give the long enumeration in the file "token.h" a name like "OCC_token"? 3. Can it be moved to a new file "opencxx_token_id.h" so that it can be separately included? 4. Please replace all "ints" that are used for token identifiers in method signatures by this new name to enhance type safety. - The method "What" seems a candidate for this change. - Will the method "IsA(int ...)" need also an update then? 5. Can the work for this type identifiers be done by virtual methods that are derived from abstract base classes? Would you like to get independence from this specific numbers? Examples for use cases: - http://industriallogic.com/xp/refactoring/conditionalWithStrategy.html - http://industriallogic.com/xp/refactoring/typeCodeWithClass.html - http://www.refactoring.com/catalog/replaceTypeCodeWithClass.html - http://www.refactoring.com/catalog/replaceConditionalWithPolymorphism.html Sincerely, Markus Elfring |