How hard is it to migrate a project from Delphi 7 to Delphi XE?

前端 未结 6 1454
萌比男神i
萌比男神i 2021-02-01 02:40

Our company have a software that has been in development for over 10 years, so there are some really dated stuff in there. It\'s still quite functional and everything, but I see

相关标签:
6条回答
  • 2021-02-01 02:55

    Some small tools either migrate without needing to do any modifications, or just a couple of unicode fixes to get it to run.

    However, if your codebase is as huge as you're explaining, you shouldn't completely rely on what anyone here is going to tell you. Just get a copy of XE and load the code. See what problems you run into to get a feel for the amount of effort it's going to take.

    At this moment I've ported all of my code to XE (even old projects). I re-use the same libraries as much as possible, so once I've converted most of those, "porting" applications from Delphi 7 to Unicode Delphi's was usually merely a repetitive task to either deal with updated interfaces in the libraries, or to fix compiler errors and warnings.

    Most common errors that I've encountered:

    • Unicode stuff. This will take 90% of the time. It's annoying if the code does a lot of low-level string handling, but most of the problems can easily be fixed by adding some typecasts.

    • the compiler bitches when you use c in ['a'..'z']. You're supposed to use CharInSet() for unicode strings.

    • If you set ShortDateFormat, you'll get a compiler warning that you should use FormatSettings.ShortDateFormat instead. In new code that's a good idea. If you're porting, just ignore it initially if you just want to get going.

    Additionally, you'll probably upgrade your third party libraries to newer versions, so that you don't have to port those yourself. It's not uncommon for those to have changed their interfaces or workings, so i'd download some trial versions of those to see what has been changed.

    0 讨论(0)
  • 2021-02-01 02:57

    My project is about a million lines of code and I recently ported from CB9 to XE. To cut down on the amount of work I first rewrote a lot so I was no longer dependant on 3rd party component packs, then carefully went over everything string related (unicode) and only then moved to XE. The preparation was a lot of work, the actual port was relatively easy.

    0 讨论(0)
  • 2021-02-01 03:01

    The only real problem is conversion to Unicode. You should learn how Unicode support is implemented in Delphi - start from Marco Cantu White Paper: Delphi and Unicode

    It is impossible to estimate the amount of work required to upgrade old applications to Unicode without knowing the actual code. If you were using string types in the standard way, the conversion would be easy. Any low-level tricks with string types (like storing binary data in strings) are now deprecated and the correspondent code should be rewritten.

    0 讨论(0)
  • 2021-02-01 03:02

    You mentioned SQL in one of your response comments... Does your database support unicode? If not, you could be in for a lot of work. You may need to convert databases on-the-fly or make a conversion tool for your users. You may need to upgrade the database or even switch to something else. For example, DBISAM is not unicode capable, but the vendor makes ElevateDB which is. The transition is not trivial. And some other libraries like Hyperstring, written largely in assembler, are another sore spot.

    0 讨论(0)
  • 2021-02-01 03:02

    I've been doing quite a few of those conversions.

    You should prepare by making your current code base testable. Preferably using automated unit tests, but at least have a good end-user testing plan.

    Then you should plan for the biggest portion: the Unicode conversion for both your app and your database.

    Finally there are less major, but potentially very time consuming aspects:

    • if you are using BDE, this is the time to get rid of it
    • the Delphi XE is more strict than Delphi 7
    • 3rd party library versions that bump up quite a few versions and are usually far less backward compatible than the VCL is

    When you have ported it, it is time to change things: since you have seen the whole code base, now you know where your weak points are, so you can start refactoring them and get a better app than you had before.

    0 讨论(0)
  • 2021-02-01 03:19

    It is definitely a challenge for this MIGRATION to be executed. But need good PLANNING!

    We first need to find all the possible components which also needs to be migrated along with the Code. If there are 3rd party components used in Delphi7 project which are not available then its quite complicated to get further on. Secondly, the other type conversion related to Unicode, which is quite easy. And finally ofcourse we need to get other supporting libraries, BDE, and Database Adapaters in place.

    For Rich User Interface, Delphi FireMonkey can be used.

    Delphi is getting better and better as it has now support from Desktop to Web to Mobiles application development.

    0 讨论(0)
提交回复
热议问题