简体   繁体   English

从Delphi 2006迁移到Delphi XE2

[英]Migrating from Delphi 2006 to Delphi XE2

There is a code base in delphi 2006 with no development for last many years. 在delphi 2006中有一个代码库,在过去的许多年里没有开发。 If the development needs to be activated what are the options. 如果需要激活开发有哪些选项。

  • Continue developing in 2006. (Not sure of IDE support etc.) 继续在2006年开发。(不确定IDE支持等)
  • Migrate to Delphi XE2. 迁移到Delphi XE2。 (Not sure of what it takes) (不确定需要什么)
  • Recode it in Java. 用Java重新编码。

It seems the second option is more viable but what it would involve to do that? 似乎第二种选择更可行但是它会涉及到什么呢? I read some things on Unicode support and also not sure of graphics library support. 我读了一些关于Unicode支持的东西,也不确定图形库支持。

Just to put thing in perspective, I am a Java programmer all along with experience on C/C++. 为了正确看待事物,我是一名Java程序员,并且拥有C / C ++方面的经验。 However I am trying to understand it more from the perspective of what is the least resistance path to go to market strategy. 但是,我试图从市场战略的最小阻力路径的角度来理解它。

Thanks in advance. 提前致谢。

I cannot say anything about recoding it in Java. 我不能说在Java中重新编码它。 Depending on whatever the code base does, it might be a good option, given that you say you are experienced with Java (and, I assume, not with Delphi). 根据代码库的不同,它可能是一个不错的选择,因为你说你有Java的经验(而且,我认为,不是使用Delphi)。

Regarding Upgrading to Delphi XE2: 关于升级到Delphi XE2:

Check whether any 3rd party components have been used. 检查是否已使用任何第三方组件。

If not, you will probably be able to upgrade to Delphi XE2 with very few changes. 如果没有,您可能只需很少的更改即可升级到Delphi XE2。

If yes, check whether the source code of these components is already available. 如果是,请检查这些组件的源代码是否已可用。

If not, you will have to buy new licenses of these components (and this time take the license that includes the source code!) if you want to upgrade to Delphi XE2. 如果没有,您将不得不购买这些组件的新许可证(这次需要包含源代码的许可证!)如果您想要升级到Delphi XE2。 If you are really unlucky, the company who developed these components has gone belly up. 如果你真的很不走运,开发这些组件的公司已经大肆宣传。 Then you are either stuck with Delphi 2006 or you will have to find a replacement for these components. 那么你要么坚持使用Delphi 2006,要么必须找到这些组件的替代品。

If you already got the component's source code, you might still want to check whether to upgrade them to Delphi XE2. 如果您已经获得了组件的源代码,您可能仍想检查是否将它们升级到Delphi XE2。 It might save you some headaches. 它可能会让你有些头疼。 Upgrading well written components is not a problem for an experienced Delphi developer (I have done so countless times over the years), but might prove nearly impossible for somebody who doesn't know the possible pitfalls. 对于经验丰富的Delphi开发人员而言,升级良好编写的组件并不是一个问题(多年来我已经做过无数次),但对于那些不知道可能存在缺陷的人来说,这几乎是不可能的。

The only breaking change between Delphi 2006 and XE2 (actually it happened between Delphi 2007 and Delphi 2009) is the switch to Unicode strings. Delphi 2006和XE2之间唯一的重大变化(实际上发生在Delphi 2007和Delphi 2009之间)是切换到Unicode字符串。 Switching an existing code base might be painless or a real pain in the lower back, depending on how well written it is to begin with and how it (ab)used strings. 切换现有的代码库可能是轻松的,也可能是下背部真正的痛苦,这取决于它开始时的写入程度以及它(ab)如何使用字符串。

Another option you have not yet mentioned, might be upgrading to Delphi 2007, which basically was more of a bugfix to Delphi 2006 than a real release in its own right. 您尚未提及的另一个选项可能是升级到Delphi 2007,这对Delphi 2006来说基本上是一个错误修正,而不是真正的版本。 If I remember correctly Delphi 2006 packages worked with Delphi 2007 without even recompiling. 如果我没记错,Delphi 2006软件包可以在Delphi 2007中使用,甚至无需重新编译。

A year ago I moved from 2006 to XE (not XE2). 一年前,我从2006年搬到XE(不是XE2)。 This was quite painless. 这很无痛。 The biggest thing was unicode. 最重要的是unicode。 But even that was relatively easy (in my specific case probably). 但即使这样也相对容易(可能在我的具体情况下)。 Most is handled by Delphi in a correct way. 大多数是由Delphi以正确的方式处理的。 Biggest problems were the import components, especially when character strings were used as byte strings, which in my field (music, midi) is the norm. 最大的问题是导入组件,特别是当字符串被用作字节字符串时,我的字段(音乐,midi)是常态。 There is a white paper on strings conversion on Embarcadero. 在Embarcadero上有一篇关于字符串转换的白皮书

I only use components with source available. 我只使用可用来源的组件。 If you don't, you might have have to repurchase the licenses. 如果不这样做,您可能需要重新购买许可证。

It is a long jump taking 2006 to 2011/2012! 这是2006至2011/2012的跳远比赛!

But it is possible if you consider that: 但如果您考虑到这一点,就有可能:

  • You have to convert String variables using the new conversions methods ; 您必须使用新的转换方法转换String变量;
  • You have to check all the versions between 2006 and xe/xe2 to know how the libraries have changed, bacause some have been spplited, others merged, and a few deleted ; 您必须检查2006和xe / xe2之间的所有版本,以了解库是如何更改的,因为有些已经被更改,其他已合并,还有一些被删除;
  • You have to buy/download the upgrade (if any) of your 3rd party components. 您必须购买/下载第三方组件的升级(如果有)。

If you do that 3 things, the applications will compile just fine. 如果你做了3件事,应用程序将编译得很好。

It's always easier to upgrade the IDE than rewriting the code, if there's any complexity in code beyond trivial cases like "Hello, World". 升级IDE总是比重写代码更容易,如果代码中的任何复杂性超出了“Hello,World”之类的简单案例。

Big road blocks in Delphi 2006 might be: old components without source code, unicode issues, possible use of obsolete technologies (BDE mainly), and possible some low level hacking, like using undocumented features. Delphi 2006中的重大障碍可能是:没有源代码的旧组件,unicode问题,可能使用过时的技术(主要是BDE),以及可能的一些低级别的黑客攻击,例如使用未记录的功能。

You get old versions of Delphi free when you buy XE2 licence. 当您购买XE2许可证时,您可以免费获得旧版本的Delphi。 However Delphi 2006 is not there. 但Delphi 2006并不存在。 Delphi 2007 is almost same (but better). Delphi 2007几乎相同(但更好)。 It may even be possible to use D2006 binary packages with Delphi 2007 . 甚至可以在Delphi 2007中使用D2006二进制包

When rewriting, first task for you is to find out what the software actually does. 重写时,首要任务是找出软件实际执行的操作。 Line by line. 逐行。 Then you need to duplicate that in Java, hopefully in Java style, and then you need to verify against the old software that the functionality is actually there, duplicated. 然后你需要在Java中复制它,希望是Java风格,然后你需要根据旧软件验证功能实际存在,重复。

So, you can choose between complete rewrite or something between recompile and partial rewrite, if there's problem with old components. 因此,如果旧组件出现问题,您可以在完全重写或重新编译和部分重写之间进行选择。

Read also this, old but good text: Things You Should Never Do, Part 1 另请阅读这篇旧文但很好的文章: 你不应该做的事情,第1部分

That said, you need business reason for rewrite, and someone willing to pay for it. 也就是说,你需要商业理由进行重写,并且有人愿意为此付费。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM