Geoffray wrote:
Le lundi 12 octobre 2009 21:23:50, Graeme Geldenhuys a écrit :
 And under no circumstances promote '1 source for both Delphi/Lazarus'
 because that is a recipe for problems :(
Definitely NOT!  That is a nightmare to try and maintain.

Ok I was nearly sure of that, but if someone ask me for coordination method... In an other word, is there any simple way to coordonate Delphi and Lazarus version of the same source ?

Maybe a tool using diff api or something like that.



When a source is compiled for console application , with respect to my experiences there is no much difference between Free Pascal and Delphi .

The important difficulty is caused by GUI parts of the programs .

The following idea may be tested for applicability ( I did not applied it myself yet , but this is the my next step to try ) .

Assume you have a BIG Delphi program and you want to compile it with Lazarus due to its GUI structure .

By using Lazarus , re-generate forms as much as possible .
In Delphi , convert parts to procedures ( or functions ( personally I am NOT using function because their maintenance is really very difficult ) ) unrelated to GUI parts as much as possible ( for example , checking the validity of contents of a string , computation of some formulas from some values , etc. ) . Call those procedures from Lazarus generated forms . At the end there will be GUI-independent procedures and GUI-dependent forms . Since forms are generated by Lazarus , they will be cross-platform and they will not depend on Windows unit ( We are assuming that GUI-independent procedures does NOT depend on Windows unit ) , they will be compilable and usable on platforms supported by Lazarus .

In that way , the total job is divided into three parts :

 - Maintenance of GUI-independent procedures ,
 - Maintenance of Lazarus forms .
 - Maintenance of Delphi forms .

Trying to compile a source written with Delphi specific features by Lazarus by using ifdef-else directives to distinguish Lazarus and Delphi specific parts is to generate a source which is a nightmare to maintain . To avoid such a structure I am thinking seriously to write Windows_for_Unix and Windows_for_Linux units from scratch . I think this is much easier than to maintain a source described above .


Thank you very much .

Mehmet Erol Sanliturk




--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to