Delphi Clinic C++Builder Gate Training & Consultancy Delphi Notes Weblog Dr.Bob's Webshop
Bob Swart (aka Drs.Bob) Dr.Bob's Delphi Clinics Dr.Bob's Delphi Courseware Manuals
View Bob Swart's profile on LinkedIn Drs.Bob's Delphi Notes
These are the voyages using Delphi Enterprise (and Architect). Its mission: to explore strange, new worlds. To design and build new applications. To boldly go...

Don't make ECO attributes or classes named System

Author: Bob Swart
Posted: 3/14/2006 10:36:24 AM (GMT+1)

While working on the ECO III edition of Bob's Error Report System (BERT), I was designing this Report class with attributes such as ReportDate, Status, System, etc. This leads to uncompilable code, and it took me a little while to figure out that the attribute with the name "System" was the cause of that.

Since the generated source code already uses System as namespace reference in types like System.Object, System.DateTime and System.IndexOutOfRangeException, this would lead to compiler errors when a new attribute called System (defined as property in the class Report) would override the original System namespace scope. Duh!

OK, not a bug in ECO III, but something to keep in mind. The funny thing is that attributes and classes can be given special names like "type" or "class" and even "property" but just not System. Snif...


1 Comment

Holger06/04/09 15:35:24It even depends on the language being used for code gen which words you can use and which you cannot. Basically, all the keywords of a language cannot be used. Also consider that OCL is case-insensitive as C# is. Meaning: if your model compiles it does not mean the OCL will be able to distinguish between some things (that happens to me quite a lot...)

New Comment (max. 2048 characters, no HTML):


This webpage © 2005-2017 by Bob Swart (aka Dr.Bob - All Rights Reserved.