tags:

views:

503

answers:

6

We want migrate from Delphi 7.0 to Delphi 2009, to stay up with a modern IDE and current technology. Our target platform is .NET. What is best way, to achieve this goal?

+2  A: 

Migrating from Delphi 7 to Delphi 2009 is probably straight forward, there were only minor changes (such as the recently discussed move from ANSI to Unicode strings). The move to .NET is not so straight forward, though. Although there's a VCL.NET which makes migrating GUIs possible, severeal other things will not work. So you might think of having Win32 code AND .NET code, bringing them together through COM. (I hope you already know COM, otherwise this is probably not an option;-))

+3  A: 

Remember that D2009 is a win32 version, and not .net. I suppose you want to make a two steps path, first move to D2009 and then to .net ?

Luckily, delphi is a very stable platform and it is much easier to convert old applications to latest version, but you have different thing to consider.

If your application is using BDE to access a Db then convert it to use some other technology, like ADO or DBX.

If you use 3rd party components, be sure there exist versions for D2009 and/or .NET

A very delicate aspect is string handling. If you use strings "normally" you should have no big problems, but if you use strings as "byte buffers" like you do in C then you have to be careful and try to rewrite that parts. A rule of thumb is "try to get rid of all PChar's in your code".

Giacomo Degli Esposti
We want convert in two steps. The first step is the conversion from Delphi 7.0 to a modern IDE and a actual version of the Delphi Framework. The next step would be a port to .net. .NET is ths strategic platform in our company. Maybe, the true choice is between 2007 RAD or Delphi 2009.
ChaosSpeeder
+1  A: 

Porting is never easy. However the semantics between Delphi and .NET are very close, since both had Anders Hejlsberg as their lead architect. You'll most likely need to replace the Win32 VCL calls to their equivalent VCL.NET stuff.

You might want to upgrade to the CodeGear RAD Studio, as that will let you have one IDE for both Delphi and .NET languages (mainly C#).

A lot of times I was able to drop in control replacements when moving from one technology to another. For example, I was able to replace BDE database controls with their ADO.NET replacements, without really having to change code. Ultimately, you own the code and know better than any of us.

Why do you want to target the .NET framework, when you have some very good support for Win32 executables? Delphi is already a small section of the industry, and Delphi with .NET even smaller. Delphi is always going to be a second-class citizen in the .NET world. Delphi is already a first class Win32 citizen.

hectorsosajr
We want to port to .net, because we move our other products (C++ and VB6) to the .net platform. But this should be happen in a further step.
ChaosSpeeder
+2  A: 

Delphi 2009 targets Win32 only. For .NET you could use RAD Studio 2007 which comes with Delphi personality for .NET and it should be fairly easy to port a simple VCL application to VCL.NET which targets the .NET 2.0 framework. However, if you use any third-party components and libraries you have to check for their .NET alternatives, too.

If you find this would be too much work or if you want to target the latest .NET framework you might be better off rewriting your project from scratch using Microsoft's Visual Studio and C#.

Disclaimer: I have no experience in porting Delphi Win32 projects to .NET so this is just my humble opinion.

TOndrej
+3  A: 

I'd take onboard the Unicode situation with string handling that came in from D2007 to D2009 - the changes involved in this step might affect your application a lot (only you can tell this). Also, you will need to consider what third party tools/libraries/components you are using. Not everything has made the jump to D2009 yet, and it's likely that some less-popular components might never make the jump at all.

One smarter path might be to migrate D7 to D2007 (which is a well-trodden path, largely painless with lots of wins and worthwhile improvements). Then you're in a modern, stable, pretty-up-to-date, supported Delphi platform from which you can better evaluate a jump to .Net.

My own opinion on this last stage would echo some of the other comments, mind you - unless there's some big win you get from .Net, I don't see why you would move away from Delphi. With the modern requirements of various runtimes and service packs, I think Delphi is becoming an increasingly viable relevant tool for Win32 development. Either evolve the code from D7 to D2007/D2009, or just jump from D7 to .Net; to do one and then the other seems a little odd!

robsoft
Thank you very much. Very helpful answer.
ChaosSpeeder
+1  A: 

Following on Giacomo's answer above, If you are using BDE, then I can suggest MicroOlap's DAC http://www.microolap.com/ - This will save you a lot of time in not having to convert you code to something else. I am using PostgresDAC, this product is very stable and fast.

mm2010
Thank you, but we didn't user MySQL. We must support informix, oracle and SQL-Server
ChaosSpeeder