[Lazarus] Challenge of converting a Delphi project

Mattias Gärtner nc-gaertnma at netcologne.de
Wed May 5 15:22:15 CEST 2010


Zitat von Juha Manninen <juha.manninen at phnet.fi>:

> Mattias Gärtner wrote:
>> Yes, the description is misleading. Original is "Verify object method
>> call validity", which is longer without being more clear.
>> AFAIK it only checks class typecasts.
>
> So it should be renamed to "Verify class typecasts" or something.

You can create a feature request on the fpc bug tracker.


> For this program the best would be to get rid of typecasts. It would  
> need more designing and refactoring again.
>
>
>> The code uses some dirty tricks that are doomed to fail with newer
>> Delphi versions, and even more to port to FPC and other platforms.
>
> Did you find other dirty tricks than the typecast trick for setting mouse
> events, and delegated interface methods?

I took only a quick look and I would be surprised if I already found  
all. I found that it used the dirty TCrackControl to get the event  
handlers to achieve another dirty trick called 'managed control'. Such  
things work only in projects knowing all used controls well. I guess  
the rest of the project took special care to let this work. Therefore

>> I think it is a bad example for testing the converter.
> [...]

... which means you should not make this a public example for a  
converted project. There is no guarantee that it will work next year.
Of course there are nice parts in it.


> Ok.
> I think the design of EssModel is OK but the authors implemented it in a too
> fancy way.
>
> About the editing abilities you mentioned. Ideally the only editing should be
> to select the classes and methods etc. you want included. Then an advanced
> layout algorithm takes care of the rest.
> Otherwise you have to relocate things in the diagram every time the class
> structure changes.

Yes, it needs good sorting and filtering options. Or zooming and fish  
eye techniques: show the current node at normal size and related  
smaller. Far related should be grouped.


> In my experience code generation from a diagram doesn't work very well in
> practice. Or maybe there are people who can use it but I got my classes
> screwed up completely by using the Delphi UML tool. Then I was afraid of the
> whole tool and didn't want to touch it.
>
> There are now reverse engineering class diagram tools (but not for OP) with
> automatic layout calculation, like UMLGraph http://www.umlgraph.org/. It uses
> an external program (Graphviz) for layouting.

I don't know anyone who do much UML modelling. But when we have a  
fancy class browser we can add some refactoring tools.


Mattias






More information about the Lazarus mailing list