tags:

views:

577

answers:

5

A simple google query shows a bunch of tools, which seems to convert Delphi to C# code.

Example: http://www.google.de/search?q=delphi+c%23+converter

Do you have experience with one of this tools or the approach of migration source from Delphi to the .NET platform? Is this a viable option?

Our general conditions:

  • Delphi 7.0 Platform => .NET 2.0 (or higher)
  • BDE 5.0 => ADO.NET
  • GUI - Components (TForm, TTable) => WinForm

Thank you for your help.

+5  A: 

I don't think a direct transliteration of Delphi code into C# delivers any real value. If you're going to convert to C#, why not take advantage of the distinct architecture of the .NET platform and the rich tooling available there, like the Entity Framework, etc.?

If you directly convert your Delphi/VCL source code, you will probably end up with an application which is slow (because it is working against the grain of how the FCL is intended to be used), in which would look alien to most .NET developers. You would gain nothing from useful abstractions like IQueryable/LINQ.

Yes, this is extra work, but look at it as an opportunity to improve the architecture of your applications and address craft in your source base.

Craig Stuntz
This is a big application and a rewrite from scratch is not a real option for us. Thank you for your answer.
ChaosSpeeder
I would not anticipate that a direct transliteration would be faster than doing the job correctly. Seriously. I use and like both C# and Delphi, and have converted code in both directions. A consequence of this is that anyone who thinks the job will be fast no matter how it is done is likely wrong.
Craig Stuntz
+22  A: 

I'm a bit biased, I wouldn't recommend converting the app to C#. Why do you need to? If it is working in D7, what need is there to convert it?

I'd recommend getting Delphi 2009 and moving forward that way. You'll still get the performance of a native application with the power of your existing code.

Nick Hodges
I too have an interest in converting old Delphi code into C#. The person who wrote the old code no longer works in the company, and we are essentially a C# shop now, except for the bad old legacy Delphi code. Nothing against Delphi; the application was just written poorly. Still, there is much interest in no longer having any Delphi code in production.
AlanR
+7  A: 

I had a very successful application that was written in Delphi.

Management made the decision to convert to C# - mainly because we couldn't hire good Delphi developers anymore.

The conversion was done by an external company and they did pretty much a line for line conversion.

It was a disaster: the worst of both worlds. The amount of time that they spent fixing bugs could have been spent on doing a proper rewrite.

Don't do an automated conversion - do the job properly!

Fortyrunner
BTW. I wish it was still written in Delphi..
Fortyrunner
Or better yet, why do the conversion at all?
Nick Hodges
As someone who bought a copy of Delphi 1.0 on Feb 14 1995 with his own money... I wish that were the case! But there aren't enough Delphi people around now and the community has suffered badly.
Fortyrunner
+2  A: 

It would be interesting to know the motivation behind the conversion.

There are ways to make win32 and .net code co-operate. You can make future development in .net, and keep the old codebase in delphi. And you can convert parts of the old system over to new platform when needed or when there is time.

Check out Hydra from RemObjects. I haven't used it my self, but it looks like fun..

There is no point in a line-by-line conversion, though. You would end up with something similare to what google-translate produces..

Vegar
+2  A: 

Delphi 7 -> Net 2.0

  • You will lose users below XP SP2 or Win2kSP4
  • Net 2.0 can be installed on Win98 but it won't work as you wolud expect
  • Your installation should include dotnet2 framework setup (25Mb more).
  • You will loose a lot of speed. Specialy your users on slower hardware.

BDE -> ADO.Net

Are you using SQL database or flat-file, like Paradox, DBF, ...?

If you are on flat file, then you need to convert to SQL, or live in pain.

GUI - Components (TForm, TTable) => WinForm

Note that TTable is not GUI component.

And WinForms is practically deprecated technology, with huge push on WPF and Silverlight migration. And that requires v3.5.

IMHO: If you are not going for Web based product, Delphi is still windows desktop No1.

dmajkic
Microsoft has clearly stated WinForms is not, and will not be deprecated anytime soon. Still, Delphi is far from being the go-to technology for Desktop apps since the mid 90's. See Java or DotNet
AlanR
You could argue about .NET on Desktop, but Java desktop is still poor compared to Delphi....
Fabricio Araujo