このWebサイトでは、クッキーを使用しております。
詳細は プライバシー保護およびクッキーに関する通知を参照ください。

インテリジェントでカスタマイズ可能なDB/アプリ自動変換ソリューション


DelphiからJava EEへの移行


Ispirer MnMTKはDelphiアプリケーションをSpring MVC FrameworkのJavaへ変換することができます。

このデモでIspirer MnMTKによるDelphiからJava EEへの移行を見ることができます:



変換の機能

Migrate Delphi to Java

  • Delphiソースコードのビジネスロジック (*.pas)をJavaクラスへ変換

Delphi:

  1.  
  2. unit Unit4;
  3.  
  4. interface
  5.  
  6. uses
  7. Windows, Messages, SysUtils, Variants, Classes,
  8. Graphics, Controls, Forms, Dialogs, StdCtrls;
  9.  
  10. type
  11. TForm4 = class(TForm)
  12. Button1: TButton;
  13. Edit1: TEdit;
  14. Label1: TLabel;
  15. Edit2: TEdit;
  16. procedure Button1Click(Sender: TObject);
  17. private
  18. { Private declarations }
  19. public
  20. { Public declarations }
  21. end;
  22.  
  23. var
  24. Form4: TForm4;
  25.  
  26. implementation
  27.  
  28. {$R *.dfm}
  29.  
  30. procedure TForm4.Button1Click(Sender: TObject);
  31. begin
  32. Edit1.Text :=
  33. IntToStr(StrToInt(Edit1.Text) + StrToInt(Edit2.Text));
  34. end;
  35.  
  36. end.
  37.  

Java:

  1.  
  2. import org.springframework.beans.factory.annotation.Autowired;
  3. import org.springframework.stereotype.Controller;
  4. import org.springframework.ui.Model;
  5. import org.springframework.web.bind.annotation.RequestMapping;
  6. import org.springframework.web.bind.annotation.RequestMethod;
  7. import javax.servlet.http.HttpServletRequest;
  8. import java.util.logging.Logger;
  9.  
  10. @Controller
  11. public class Unit4
  12. {
  13. Logger logger = Logger.getGlobal();
  14.  
  15. @Autowired
  16. private TForm4 Form4 = null;
  17.  
  18. @RequestMapping(value="/TForm4",method=RequestMethod.POST,
  19. params="Button1")
  20. public String Button1Click(HttpServletRequest request, Model model)
  21. {
  22. this.setPageValues(request);
  23. this.Form4.setEdit1Text(String.valueOf(
  24. Integer.parseInt(this.Form4.getEdit1Text())+
  25. Integer.parseInt(this.Form4.getEdit2Text())));
  26. this.addModelAttributes(model);
  27. return "TForm4";
  28. }
  29. public void setPageValues(HttpServletRequest request)
  30. {
  31. this.Form4.setEdit1Text(request.getParameter("Edit1"));
  32. this.Form4.setEdit2Text(request.getParameter("Edit2"));
  33. }
  34. public void addModelAttributes(Model model)
  35. {
  36. model.addAttribute("Edit1Text",this.Form4.getEdit1Text());
  37. model.addAttribute("Edit2Text",this.Form4.getEdit2Text());
  38. }
  39. }
  40.  

Pas変換はフォームクラスの自動配線に基づいており、ButtonClickメソッド、setPageValuesおよびaddModelAttrributesを含みます。これはjsp値をクラス表現に設定してそれぞれのページに送信します。

  • Delphiフォームのファイル(*.dfm) をJSPおよびJavaのクラスへ変換

Delphi:

  1.  
  2. object Form4: TForm4
  3. Left = 0
  4. Top = 0
  5. Caption = 'Form4'
  6. ClientHeight = 158
  7. ClientWidth = 201
  8. Color = clBtnFace
  9. Font.Charset = DEFAULT_CHARSET
  10. Font.Color = clWindowText
  11. Font.Height = -11
  12. Font.Name = 'Tahoma'
  13. Font.Style = []
  14. OldCreateOrder = False
  15. PixelsPerInch = 96
  16. TextHeight = 13
  17. object Label1: TLabel
  18. Left = 24
  19. Top = 107
  20. Width = 46
  21. Height = 13
  22. Caption = 'Summand'
  23. end
  24. object Button1: TButton
  25. Left = 24
  26. Top = 64
  27. Width = 153
  28. Height = 25
  29. Caption = 'Sum'
  30. TabOrder = 0
  31. OnClick = Button1Click
  32. end
  33. object Edit1: TEdit
  34. Left = 24
  35. Top = 37
  36. Width = 153
  37. Height = 21
  38. TabOrder = 1
  39. Text = '0'
  40. end
  41. object Edit2: TEdit
  42. Left = 76
  43. Top = 104
  44. Width = 101
  45. Height = 21
  46. TabOrder = 2
  47. Text = '0'
  48. end
  49. end
  50.  

Java:

  1.  
  2. package com.ispirer.controller.demo.Logic;
  3.  
  4. import org.springframework.stereotype.Controller;
  5. import org.springframework.ui.Model;
  6. import org.springframework.web.bind.annotation.RequestMapping;
  7.  
  8. @Controller
  9. public class TForm4
  10. {
  11. private String Edit1Text = null;
  12. private String Edit2Text = null;
  13.  
  14. public String getEdit1Text()
  15. {
  16. return Edit1Text;
  17. }
  18.  
  19. public void setEdit1Text(String edit1Text)
  20. {
  21. Edit1Text = edit1Text;
  22. }
  23.  
  24. public String getEdit2Text()
  25. {
  26. return Edit2Text;
  27. }
  28.  
  29. public void setEdit2Text(String edit2Text)
  30. {
  31. Edit2Text = edit2Text;
  32. }
  33.  
  34. @RequestMapping(value = "/TForm4")
  35. public String FormCreate(Model model)
  36. {
  37. this.Edit1Text = "0";
  38. model.addAttribute("Edit1Text",this.Edit1Text);
  39. this.Edit2Text = "0";
  40. model.addAttribute("Edit2Text",this.Edit2Text);
  41. return “TForm4";
  42. }
  43. }
  44.  

JSP:

  1.  
  2. <%@taglib prefix="c"
  3. uri="http://java.sun.com/jsp/jstl/core"%>
  4. <%@taglib prefix="form"
  5. uri="http://www.springframework.org/tags/form"%>
  6. <%@taglib prefix="mvc"
  7. uri="http://www.springframework.org/tags/form"%>
  8. <%@page contentType="text/html;charset=UTF-8" language="java"%>
  9. <html>
  10. <head>
  11. <title>Form4</title>
  12. <link rel="stylesheet" type="text/css"
  13. href="<c:url value="/resources/css/style.css"/>" />
  14. </head>
  15. <body>
  16. <div class="layout">
  17. <div class="left">
  18. </div>
  19. <div class="content">
  20. <form:form method="post">
  21. <label
  22. style="left:24px;top:107px;width:46px;height:13px;">Summand</label>
  23. <input type="submit" name="Button1" value="Sum"
  24. style="left:24px;top:64px; width:153px;height:25px;"/>
  25. <input type="text" name="Edit1" value="${Edit1Text}"
  26. style="left:24px;top:37px; width:153px;height:21px;"/>
  27. <input type="text" name="Edit2" value="${Edit2Text}"
  28. style="left:76px;top:104px; width:101px;height:21px;"/>
  29. </form:form>
  30. </div>
  31. <div class="right">
  32. </div>
  33. </div>
  34. </body>
  35. </html>
  36.  
Delphi Java
Migrate Delphi to Java Migrate Delphi to Java

Dfmファイルは様々な属性からなっています。このスクリプトの為、Ispirer MnMTKはJSPおよびJavaクラスを生成します。Delphiフォームはコンテンツが含む<div class=”content”> タグと適切なアプリケーションビューの為のデフォルトccsファイルの3列のJSPに変換されます。また、SQLWayは、Delphiコンポーネントのモデルアナログをgetメソッドのクラスのフィールドとして生成します。 フォームの属性はFormCreateメソッドで指定されます。

  • Delphiのデータアクセス (BDE、ADO等)をJavaのデータベースアクセスのフレームワーク (JDBC、Hibernate、Torque等)へ変換

Delphi:

  1.  
  2. end object Form2: TForm2
  3. Left = 0
  4. Top = 0
  5. Width = 156
  6. Height = 198
  7. Caption = 'Test'
  8. Color = clBtnFace
  9. Font.Charset = DEFAULT_CHARSET
  10. Font.Color = clWindowText
  11. Font.Height = -11
  12. Font.Name = 'Tahoma'
  13. Font.Style = []
  14. OldCreateOrder = False
  15. PixelsPerInch = 96
  16. TextHeight = 13
  17. object DBGrid1: TDBGrid
  18. Left = 32
  19. Top = 8
  20. Width = 81
  21. Height = 120
  22. DataSource = DataSource1
  23. TabOrder = 0
  24. TitleFont.Charset = DEFAULT_CHARSET
  25. TitleFont.Color = clWindowText
  26. TitleFont.Height = -11
  27. TitleFont.Name = 'Tahoma'
  28. TitleFont.Style = []
  29. Columns = <
  30. item
  31. Expanded = False
  32. FieldName = 'col1'
  33. Visible = True
  34. end>
  35. end
  36. object ADOConnection1: TADOConnection
  37. Connected = True
  38. ConnectionString =
  39. 'Provider=MSDASQL.1;Persist Security Info=False;
  40. User ID=sa;Data S' +
  41. 'ource=MSSQL_VMDBSRV002_ETEST'
  42. Left = 24
  43. Top = 136
  44. end
  45. object ADOQuery1: TADOQuery
  46. Active = True
  47. Connection = ADOConnection1
  48. CursorType = ctStatic
  49. Parameters = <>
  50. SQL.Strings = (
  51. 'select col1 from tab1_test')
  52. Left = 56
  53. Top = 136
  54. end
  55. object DataSource1: TDataSource
  56. DataSet = ADOQuery1
  57. Left = 88
  58. Top = 136
  59. end
  60. end
  61.  

Java:

  1.  
  2. import java.sql.*;
  3. import org.springframework.stereotype.Controller;
  4. import org.springframework.ui.Model;
  5. import org.springframework.web.bind.annotation.RequestMapping;
  6. import util.TDBGrid;
  7.  
  8. @Controller
  9. public class TForm2
  10. {
  11. private TDBGrid DBGrid1 = null;
  12. private static String[] connectionString=
  13. {"jdbc:odbc:MSSQL_VMDBSRV002_ETEST","sa","" };
  14. public static Connection ADOConnection1()
  15. {
  16. try
  17. {
  18. return DriverManager.getConnection(
  19. connectionString[0],
  20. connectionString[1],
  21. connectionString[2]);
  22. }
  23. catch(SQLException e)
  24. {
  25. e.printStackTrace();
  26. }
  27. return null;
  28. }
  29. private PreparedStatement ADOQuery1 = null;
  30. private String ADOQuery1_SQL_Strings =
  31. "select col1 from tab2_test";
  32. private ResultSet DataSource1 = null;
  33. public void setADOQuery1(PreparedStatement ADOQuery1)
  34. {
  35. this.ADOQuery1 = ADOQuery1;
  36. }
  37. public PreparedStatement getADOQuery1()
  38. {
  39. return this.ADOQuery1;
  40. }
  41. public void setADOQuery1_SQL_Strings(String ADOQuery1_SQL_Strings)
  42. {
  43. this.ADOQuery1_SQL_Strings = ADOQuery1_SQL_Strings;
  44. }
  45. public String getADOQuery1_SQL_Strings()
  46. {
  47. return this.ADOQuery1_SQL_Strings;
  48. }
  49. public void setDataSource1(ResultSet DataSource1)
  50. {
  51. this.DataSource1 = DataSource1;
  52. }
  53. public ResultSet getDataSource1()
  54. {
  55. return this.DataSource1;
  56. }
  57. public void initDBGrid1(Model model)
  58. {
  59. this.DBGrid1 = new TDBGrid(this.DataSource1,new String[]
  60. { "col1" });
  61. this.DBGrid1.initDBGridModel();
  62. model.addAttribute("DBGrid1",this.DBGrid1.getDBGridModel());
  63. model.addAttribute("DBGrid1ColWidth",new Integer[] { 100 });
  64. }
  65. @RequestMapping(value = "/TForm2")
  66. public String FormCreate(Model model)
  67. {
  68. try
  69. {
  70. this.ADOQuery1 =
  71. ADOConnection1().prepareStatement(getADOQuery1_SQL_Strings(),
  72. ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
  73. }
  74. catch(SQLException e)
  75. {
  76. e.printStackTrace();
  77. }
  78. try
  79. {
  80. this.DataSource1 = this.ADOQuery1.executeQuery();
  81. }
  82. catch(SQLException e)
  83. {
  84. e.printStackTrace();
  85. }
  86. initDBGrid1(model);
  87. return "TForm2";
  88. }
  89. }
  90.  
Delphi Java
Migrate Delphi to Java Migrate Delphi to Java

上記は、TADOConnection、TADOQuery、TDataSourceの使用によるIspirer MnMTK DBGrid変換の例です。その結果、SQLWaysはデータベースから詰めるテーブルのJSPを生成します。また、Ispirer MnMTKはデータベーステーブルに従ってHibernate、Torque XMLマップを自動的に生成することができます。


なぜIspirer MnMTKなのか

Ispirer MnMTKは現行のDelphiアプリケーションをJavaへの移行作業を自動化し、移行作業に伴うリスクと必要な内部作業を大幅に削減する事ができます。Ispirer MnMTKはこれらの利点と共にお手頃な価格でデータベースおよびアプリケーションの変換を行う事ができるため、このような移行プロジェクトにとってとても魅力的なツールです。

弊社の変換技術の利点

  • 読み易くて、保守し易いコード
    インテリジェントで保守し易いコードを生成します。
  • コード変換とリファクタリング
    コード変換による、Javaの最善慣行を実現することができます。
  • 最新技術
    Javaフレームワークと技術の使用 。
  • Javaの純粋なコード
    変換後のソースの利用に特別なIspirerライブラリーとIPは必要ありません。

SQLWaysは大規模なスクリプトの変換に関して、効果的に実行することができます:

  • 自動的な依存関係の解決
    ツールは依存ファイルやデータベース等から情報を抽出し、依存関係や競合を自動的に解決することができます。
  • コンフィギュレーション
    ツールは様々なファイルからの情報を読み出すことができます(SQLWays コンフィギュレーションファイル、 .xmlファイル)。
  • 迅速で強力なカスタマイズ
    抽象的なレイヤー、再利用可能な変換テンプレート、内部変換言語およびツールにより、迅速なカスタマイズと複雑なコード変換が可能になります。

Delphiのソースコードサンプルと変換の結果をダウンロードできます:

弊社のアプローチ

アセスメント作業は簡単ですぐに移行に要する作業とコストを見積もることができます。お見積に必要な情報は、下記のフォームを参照いただくと揃えることができます:

ISV会社の場合は、Ispirerは大規模のアプリケーションを変換する為、包括的な共同作業モデルを提供しています。

弊社の移行サービスに興味があれば、お問い合わせください。

 
Testimonials
Schulz, Brazil

InterBase to Microsoft SQL Server
Database Migration

In order to change a factory supervision and information system, we were looking for a tool to migrate the existing "Interbase 6.0" database to "Microsoft SQL Server". We tested a few softwares, but they didn't suit us.

...

System Protocol Information, Malaysia

Informix to Microsoft SQL Server
Database Migration

Dear Sir / Madam,

We have just completed our biggest migration job to date from Informix to MS SQL Server. The exercise was efficiently done within schedule given to us. It was a success and thanks to a great part to your tool.

...

Case Studies
Sybase ASEからMicrosoft SQL Serverへの移行、チリ

チリに拠点を置くソフトウェア開発会社です。

...

IBM DB2 iSeriesからMicrosoft SQL Serverへの移行、アメリカ

ソフトウェアとアプリケーションの開発、リエンジニアリングとメンテナンスを専門とする、米国に本拠を置くフルサービスのIT企業です。 同社はウェブサイトデザイン、ウェブホスティング、SEOなどのウェブサービスを提供しています。 また、CRMシステムの導入、アップグレードおよび管理も実施しています。

...