Holger's Thoughts on Delphi

Thursday, September 21, 2006

Thanks Jeremy!

So, here I was, telling you guys about my tool that has to be invoked using the command line in order to fix the ECO III code generation issues.

And now... Well, Jeremy North took my source and made it an IDE plugin. So no more command line. So far the thing looks awesome. Will tinker with it a little bit more, before releasing it.

Thanks again, Jeremy!

Wednesday, September 20, 2006

ECO: Code generation in BDS 2006 and Delphi .NET

Okay, you all know by now, I am a huge fan of ECO. Today I found out though that if you keep making modifications to your model and constantly generate code for Delphi .NET that the code generator will generate code that does simply not compile.

Firstly, deactivate the option "One file per class" for the code generation in Delphi (see screenshot) in case you enabled it. It is set to "off" by default when you install BDS.

You get to this dialog using "Tools / Options...". There are two issues if you leave it checked:
  • uses-clause: The uses clause is not being generated correctly if you e.g. have a method that returns another class which resides in another unit. You will have to add the references yourself.
  • duplicate names: if an association(-end) has the same name as a class you get type-conflicts and will have to use the full name and thus edit the code manually
Secondly, "begin"/"end" blocks are preceded by multiple empty lines. With every code generation invocation another empty line is being added.
Finally - and this is the most annoying - Uml-tags will be generated everytime you invoke the code generator and thus the code becomes incompilable as well.

I wrote a simple command-line tool, which automatically makes the necessary changes for the last two cases. The uses-clause and duplicate-names issue can be neglected as you can set the options to circumvent it.

Be aware that this tools comes without any guarantee or liability. Use it at your own risk.

You can download it from CodeCentral.

Monday, September 04, 2006

Holger in public :-)

The next weeks are going to be busy for me - at least for what I am used to.

First, I will be in Stockholm, Sweden next week. There are still a few seats available for an excellent Delphi Developer Group meeting there on the 14th. You will be able to meet the ECO Team, Henrik Jondell and Hellström. I will also host a session there, showing ECO with ASP.NET.

Secondly, I will be a coach at the Code Camp at EKON 10 in Frankfurt, Germany on September 27th for the ECO section.

Maybe, I will see you at one of the two events