Delphi .NET Migration

Gunnar Sommestad  Delphi Consultant in Stockholm, Sweden.  

Delphi 7

Upgrade your code to Delphi 7 in a first step.

The Delphi 7 compiler gives you early warnings for "unsafe code".

Conversion checklist

  • Rewrite code with untyped pointer variables and code containing GetMem. Adjust some string handling routines.Rewrite code using variant record formats.
  • Migrate to .NET with a limited number of classes like streams, file and sockets and check if there are good replacements or workarounds for Win API calls.
  • Other issues: A few VCL components and properties are not supported. Minor data type and code convention changes.
  • Wrappers for COM modules

 

 
 

 

 

 

 

 

.NET with VCL classes

Pros

  • Limited conversion work
  • Your GUI is conserved

Cons

  • .NET code not certified to run on networks.
  • Platform dependent (on PC Windows)
 

... and for platform independence

  • Replace the VCL GUI with Windows.Forms (= rebuild all your forms from scratch)
  • Rewrite database access parts (ADO.NET)
  • Replace a number of other VCL or Windows platform specific parts with .NET versions. (Generally you have to migrate to .NET Framework syntax(classes) with all that is not part of the Delphi language implementation itself.)
  • Enjoy the advantages of being able to migrate code easily to and from C#
 

Q: Why care about Delphi conversion?

A: Your code is reusable. Transfer more than 50% and sometimes 90-100% without any editing.

Glue Delphi, VB and C# assemblies together easily. Migrate in steps. (Note that you can mix Delphi/VCL .NET and "pure" Delphi .NET as well).

Also note that VCL classes will be fully supported in coming Delphi versions.

 

gunnar@sommestad.com

CV (in Swedish)

100% .NET

Pros

  • Standard, easy to mix with C# and Visual Basic (or port the Delphi code to those languages.)
  • Potential for platform independence: Console applications will already run under Linux/Mono

Cons

  • Extensive modifications for visual applications and database parts.