JP4686117B2 - Source code conversion apparatus, source code conversion method, and program - Google Patents

Source code conversion apparatus, source code conversion method, and program Download PDF

Info

Publication number
JP4686117B2
JP4686117B2 JP2003161029A JP2003161029A JP4686117B2 JP 4686117 B2 JP4686117 B2 JP 4686117B2 JP 2003161029 A JP2003161029 A JP 2003161029A JP 2003161029 A JP2003161029 A JP 2003161029A JP 4686117 B2 JP4686117 B2 JP 4686117B2
Authority
JP
Japan
Prior art keywords
conversion
application resource
definition
resource template
screen
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2003161029A
Other languages
Japanese (ja)
Other versions
JP2004362343A (en
Inventor
雅樹 米谷
誠司 濱田
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
International Business Machines Corp
Original Assignee
International Business Machines Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by International Business Machines Corp filed Critical International Business Machines Corp
Priority to JP2003161029A priority Critical patent/JP4686117B2/en
Publication of JP2004362343A publication Critical patent/JP2004362343A/en
Application granted granted Critical
Publication of JP4686117B2 publication Critical patent/JP4686117B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Devices For Executing Special Programs (AREA)
  • Stored Programmes (AREA)

Description

【0001】
【発明の属する技術分野】
本発明は、過去に開発されたアプリケーションプログラム(以下、単に「アプリケーション」という)のソースコードを、移行したい環境(以下、「ターゲット環境」という)で動作するように変換する技術に関し、特に、ターゲット環境における標準化されたフレームワークに適合するようにソースコードの変換を行うソースコード変換装置等に関する。
【0002】
【従来の技術】
今日、WebSphere Application ServerをはじめとするJ2EE(Java 2 Enterprise Edition)環境の普及により、過去に開発された既存アプリケーションをJ2EE環境に移行させ稼動させたいという要求が増えてきている(WebSphereは、IBM Corporationの米国およびその他の国における商標。)。しかし、そのような既存アプリケーションは、J2EE環境で動作するアプリケーションの開発言語であるJAVAとは異なる言語、例えば、Visual Basic等で開発されている場合が多い(JAVAおよびすべてのJAVA関連の商標およびロゴは、Sun Microsystems, Inc.の米国およびその他の国における商標または登録商標。Visual Basicは、米国およびその他の国における米国Microsoft Corp.の登録商標。)。また、クラスライブラリ(例えば、DBアクセス)、フレームワークのみならず、アプリケーションの稼動形態においてもJ2EE環境とは異なる場合が多い。例えば、既存アプリケーションの環境が、アプリケーションのロジックが配置されるクライアントと、アプリケーションが使用するデータが配置されるサーバという2階層の構造をしているのに対し、J2EE環境が、画面表示を主に行うクライアントと、アプリケーションのロジックが配置されるアプリケーションサーバと、アプリケーションが使用するデータが配置されるデータベースサーバという3階層の構造をしている等の違いである。従って、既存アプリケーションをJ2EE環境に移行するのは容易ではなく、その作業には多大な工数が必要となる。
【0003】
そこで、過去に開発されたアプリケーションの新しい環境への移行を支援するため、従来は、既存システムを解析し、新システム構築の際に必要となる画面情報を出力したり(例えば、特許文献1参照。)、既存システムを解析し、新システムのインターフェース情報(画面定義情報・画面動作情報・画面遷移情報)を再生成したりしていた(例えば、特許文献2参照。)。
【0004】
【特許文献1】
特開2001−027946号公報(第3−5頁、図2)
【特許文献2】
特開2001−134423号公報(第2−4頁、図2)
【0005】
【発明が解決しようとする課題】
ところで、近年、アプリケーション移行時における、品質、生産性、保守性向上の観点から、フレームワークを採用するケースが増えている。フレームワークとは、Webアプリケーションを開発するための枠組みであり、規定されていない細部を規定することによって1つの完成したWebアプリケーションを効率的に開発できるようにするためのものである。フレームワークには、例えば、アパッチ・ソフトウェア・ファウンデーションの「Jakartaプロジェクト」が開発する「Struts」のように急速に人気を集め、標準的に用いられているものも存在する。
【0006】
しかしながら、特許文献1、2には、既存システムにおけるインターフェース情報を表示することで新システムにおけるインターフェース情報の構築作業を軽減することしか述べられておらず、新システムで採用するWebアプリケーションフレームワークに適合するようにインターフェース情報を変換することは行っていなかった。即ち、ターゲット環境における標準化されたフレームワークを利用することによる利点を減ずることなく既存アプリケーションのソースコードをターゲット環境で動作するように変換することはできないという問題点があった。
【0007】
本発明は、以上のような技術的課題を解決するためになされたものであって、その目的は、既存アプリケーションのソースコードを、ターゲット環境における標準化されたフレームワークを利用することによる利点を減ずることなく、ターゲット環境で動作するように変換することにある。
また他の目的は、既存アプリケーションのソースコードをターゲット環境における標準化されたフレームワークに適合させるための変換を柔軟に行えるようにすることにある。
更に他の目的は、既存アプリケーションのソースコードを複数のフレームワークのうちの所望のものに適合するよう変換できるようにすることにある。
【0008】
【課題を解決するための手段】
かかる目的のもと、本発明は、既存アプリケーションのソースコードを、ターゲット環境におけるアプリケーションリソーステンプレートに変換している。即ち、本発明のソースコード変換装置は、アプリケーションプログラムのソースコードを解析して解析情報(図1の画面解析情報に対応)を生成する解析手段(図1の画面解析処理部11に対応)と、この解析手段により生成された解析情報を予め定められた変換規則(変換ルール)に従って変換することで、所定のターゲット環境におけるアプリケーションリソーステンプレートを生成する変換手段(図1の要素変換処理部13に対応)とを備えている。
【0009】
また、本発明において、既存アプリケーションのソースコードを解析して得られる画面解析情報は、ソースコードから抽出した各要素を細分化し、分離して保持するようにしている。即ち、本発明のソースコード変換装置において、解析手段は、ソースコードから複数の要素を抽出し、各要素を分離して解析情報に含めることを特徴とする。尚、この場合、変換規則が、解析情報に含まれる変換前の要素または要素集合と、アプリケーションリソーステンプレートに含まれる変換後の要素との対応を規定し、変換手段が、変換規則を参照し、変換前の要素または要素集合を、対応する変換後の要素に変換するようにすることができる。また、変換規則が、複数のターゲット環境の各々に対応して設けられ、変換手段が、解析情報を、要求されたターゲット環境に対応する変換規則に従って変換するようにすることもできる。
【0010】
一方、本発明のソースコード変換装置は、アプリケーションリソーステンプレートを予め定められた配置規則(配置ルール)に従ってターゲット環境に配置することで、アプリケーションテンプレートを生成する配置手段(図1の要素配置処理部15に対応)を更に備える。
【0011】
また、配置規則が、アプリケーションリソーステンプレートと、アプリケーションリソーステンプレートをターゲット環境に配置するための配置処理情報との対応を規定し、配置手段が、配置規則を参照し、アプリケーションリソーステンプレートを配置処理情報に基づいてターゲット環境に配置するようにすることができる。更に、配置手段は、配置処理情報がターゲット環境におけるアプリケーションリソーステンプレートの配置位置をユーザが指定可能なことを示す場合に、配置位置をユーザに指定させることもできる。更にまた、配置規則が、複数のターゲット環境の各々に対応して設けられ、配置手段が、アプリケーションリソーステンプレートを、要求されたターゲット環境に対応する配置規則に従って配置するようにすることもできる。
【0012】
他の観点から捉えると、本発明のソースコード変換方法は、アプリケーションプログラムのソースコードを解析して解析情報を生成するステップ(図4のステップ101に対応)と、生成された解析情報(図4の画面解析情報に対応)を予め記憶装置に記憶された変換規則(変換ルール)に従って変換することで、所定のターゲット環境におけるアプリケーションリソーステンプレートを生成するステップ(図4のステップ104〜106に対応)と、生成されたアプリケーションリソーステンプレートを予め記憶装置に記憶された配置規則(配置ルール)に従ってターゲット環境に配置することで、アプリケーションテンプレートを生成するステップ(図4のステップ107、108に対応)とを含んでいる。
【0013】
また、解析情報を生成するステップでは、ソースコードから複数の要素を抽出し、各要素を分離して木構造で表現した中間ソースコードを、解析情報として記憶することを特徴とする。尚、この場合、アプリケーションリソーステンプレートを生成するステップでは、記憶装置から、変換前の要素または要素集合と変換後の要素とを対応付けた変換規則を読み出し、その変換規則において変換前の要素または要素集合として規定される解析情報内の要素を、対応する変換後の要素に変換することで、解析情報を変換するようにすることができる。また、アプリケーションリソーステンプレートを生成するステップでは、記憶装置に記憶された複数の変換規則のうち、要求されたターゲット環境に対応する変換規則を読み出し、解析情報をその変換規則に従って変換するようにすることもできる。
【0014】
更に、アプリケーションテンプレートを生成するステップでは、記憶装置から、各アプリケーションリソーステンプレートと各アプリケーションリソーステンプレートをターゲット環境に配置するための配置処理情報とを対応付けた配置規則を読み出し、アプリケーションリソーステンプレートを対応する配置処理情報に基づいてターゲット環境に配置するようにすることができる。更にまた、アプリケーションテンプレートを生成するステップでは、記憶装置に記憶された複数の配置規則のうち、要求されたターゲット環境に対応する配置規則を読み出し、アプリケーションリソーステンプレートをその配置規則に従って配置するようにすることもできる。
【0015】
ここで、本発明は、コンピュータに所定の機能を実現させるプログラムとして把握することができる。即ち、本発明のプログラムは、コンピュータに、アプリケーションプログラムのソースコードを解析して解析情報(図1の画面解析情報に対応)を生成する機能(図1の画面解析処理部11に対応)と、生成された解析情報を予め記憶装置に記憶された変換規則(変換ルール)に従って変換することで、所定のターゲット環境におけるアプリケーションリソーステンプレートを生成する機能(図1の要素変換処理部13に対応)と、生成されたアプリケーションリソーステンプレートを予め記憶装置に記憶された配置規則(配置ルール)に従ってターゲット環境に配置することで、アプリケーションテンプレートを生成する機能(図1の要素配置処理部15に対応)とを実現させる。
【0016】
また、解析情報を生成する機能では、ソースコードから複数の要素を抽出し、各要素を分離して木構造で表現した中間ソースコードを、解析情報として記憶する機能を更に実現させることを特徴とする。尚、この場合、アプリケーションリソーステンプレートを生成する機能では、記憶装置に記憶された複数の変換規則のうち、要求されたターゲット環境に対応する変換規則を読み出し、解析情報をその変換規則に従って変換する機能を更に実現させることができる。また、アプリケーションテンプレートを生成する機能では、記憶装置に記憶された複数の配置規則のうち、要求されたターゲット環境に対応する配置規則を読み出し、アプリケーションリソーステンプレートをその配置規則に従って配置する機能を更に実現させることもできる。
【0017】
【発明の実施の形態】
以下、添付図面に示す実施の形態に基づいて本発明を詳細に説明する。
図1は、本実施の形態の全体構成を示すブロック図である。図1に示すように、本実施の形態は、既存アプリケーションソースコード記憶部10と、画面解析処理部11と、画面解析情報記憶部12と、要素変換処理部13と、新規アプリケーションリソーステンプレート記憶部14と、要素配置処理部15と、新規アプリケーションテンプレート記憶部16とを含む。
【0018】
既存アプリケーションソースコード記憶部10は、過去に開発された既存アプリケーションのソースコードを記憶する部分である。アプリケーションは、通常、画面定義部、操作仕様実装部、業務仕様実装部から構成されるが、本実施の形態では、画面解析処理部11がこれらのうち画面定義部と操作仕様実装部のみを解析するので、この2つの部分を四角囲みで示している。
【0019】
画面解析処理部11は、既存アプリケーションソースコード記憶部10に記憶された既存アプリケーションソースコードの画面定義部と操作仕様実装部とから、画面定義、画面遷移定義、イベント定義のみを抽出し、画面解析情報を生成して画面解析情報記憶部12に記憶する部分である。
【0020】
画面解析情報記憶部12は、画面解析処理部11により抽出された画面解析情報を記憶する部分である。画面解析情報内の要素としては、画面定義、画面遷移定義、イベント定義がある。また、画面定義内の要素としては、画面要素定義、各画面要素属性があり、画面遷移定義内の要素としては、遷移元画面、遷移先画面・状態、遷移条件、遷移起動イベントがあり、イベント定義内の要素としては、イベントソース、イベント種別がある。尚、画面解析情報は、再利用可能な中間形式のフォーマットで保持される。例えば、各要素をXML形式等の木構造で記述したソースコード(以下、「中間ソースコード」という)として保持される。この中間ソースコードにおいて、要素間の関係は、親子関係または接続要素で保持され、要素集合変換時に必要とする要素を収集し易くしている。
【0021】
要素変換処理部13は、画面解析情報記憶部12から画面解析情報を入力し、要求されたターゲット環境の種別に応じた変換ルールに従い各要素を変換して新規アプリケーションリソーステンプレートを生成し、新規アプリケーションリソーステンプレート記憶部14に出力する部分である。例えば、要求され得るターゲット環境として、StrutsとXFormsとがあれば、Struts用変換ルールとXForms用変換ルールとが用意され、要求されたターゲット環境に応じてこのいずれかが選択され用いられる。
【0022】
新規アプリケーションリソーステンプレート記憶部14は、要素変換処理部13により生成された新規アプリケーションリソーステンプレートを記憶する部分である。ここで、「アプリケーションリソーステンプレート」とは、フレームワークにおいて必要となるファイルのことで、以下、単に「リソース」ともいう。これには、例えば、画面リソース、構成ファイル、ソースコード等がある。
【0023】
要素配置処理部15は、新規アプリケーションリソーステンプレート記憶部14に記憶されたアプリケーションリソーステンプレートを要求されたターゲット環境の種別に応じた配置ルールに従い配置して新規アプリケーションテンプレートを生成し、新規アプリケーションテンプレート記憶部16に出力する部分である。例えば、要求され得るターゲット環境として、StrutsとXFormsとがあれば、Struts用配置ルールとXForms用配置ルールとが用意され、要求されたターゲット環境に応じてこのいずれかが選択され用いられる。尚、これらの配置ルールに定義される配置情報については、対象Webアプリケーションフレームワークに応じてそのデフォルト値が与えられている。また、対象Webアプリケーションフレームワークにおける配置情報をユーザが必要に応じて入力し画面解析情報に付加することもできるようになっている。
【0024】
新規アプリケーションテンプレート記憶部16は、要素配置処理部15により生成された新規アプリケーションテンプレートを記憶する部分である。ここで、「アプリケーションテンプレート」とは、フレームワークにリソースが配置されたものである。例えば、要求され得るターゲット環境として、StrutsとXFormsとがあれば、Struts用新規アプリケーションテンプレートと、XForms用新規アプリケーションテンプレートとが生成可能である。
【0025】
尚、本実施の形態は、コンピュータシステムにより実現される。本実施の形態を実現するコンピュータシステムのハードウェア構成は、中央処理装置(CPU)、主記憶装置、ハードディスク装置等の補助記憶装置、入力装置、出力装置を備えた一般的なものでよい。
補助記憶装置には、画面解析処理部11、要素変換処理部13、要素配置処理部15を実現するためのプログラムが記憶され、CPUがこのプログラムを主記憶装置に読み込んで実行することにより、画面解析処理部11、要素変換処理部13、要素配置処理部15が実現される。また、補助記憶装置は、既存アプリケーションソースコード記憶部10、新規アプリケーションリソーステンプレート記憶部14、新規アプリケーションテンプレート記憶部16としても機能する。更に、要素変換処理部13で用いられる変換ルール、要素配置処理部15で用いられる配置ルールを補助記憶装置に記憶するようにしてもよい。
【0026】
次に、画面解析処理部11および要素変換処理部13における処理を、概念図を参照しながら説明する。ここでは、既存アプリケーションの開発言語としてよく用いられるVisual Basicで開発されたアプリケーションを、J2EE環境でよく用いられるStrutsフレームワークのリソースへ変換する場合を例にとって説明する。但し、既存アプリケーションの開発言語はVisual Basicに限られるものではなく、ターゲット環境における開発言語と異なるものであれば、如何なる言語であってもよい。また、ターゲット環境もStrutsフレームワークに限らず、XForms等、他の環境であってよい。
【0027】
まず、画面解析処理部11がVisual Basicで記述されたアプリケーションの各要素を画面解析情報の各要素に変換する時の処理について説明する。
Visual Basicで記述されたアプリケーションは、イベントドリブンであるので、画面要素とイベントハンドラ、イベントハンドラ内の各要素が密に結合している。従って、そのまま、アプリケーション構造を変換することは容易でない。そこで、本実施の形態では、Visual Basicの各要素を細分化し、それら要素間の結合を緩めて保持するようにしている。これにより、Webアプリケーションフレームワークへの柔軟な変換機構を実現している。
【0028】
図2に、具体的な変換の様子を示す。図2では、左側に、Visual Basicで記述されたアプリケーションにおける各要素が示され、右側に、画面解析情報における各要素が示される。この変換処理において、Visual Basicにおける画面定義は、画面解析情報における画面定義(画面要素定義、各画面要素属性)に変換され、Visual Basicにおけるイベントハンドラは、画面解析情報における画面遷移定義(遷移元画面、遷移先画面・状態、遷移起動イベント)に変換され、Visual Basicにおける起動イベントは、画面解析情報におけるイベント定義(イベントソース、イベント種別)に変換されている。
【0029】
次に、要素変換処理部13が画面解析情報の各要素をWebアプリケーションフレームワークのリソースに変換する時の処理について説明する。
図3に、具体的な変換の様子を示す。図3では、左側に、画面解析情報における各要素が示され、右側に、Strutsフレームワークにおけるリソースが示される。この変換処理において、画面解析情報における画面定義は、StrutsフレームワークにおけるJSPに変換され、画面解析情報における画面遷移定義は、StrutsフレームワークにおけるAction Classに変換され、画面解析情報におけるイベント定義および遷移先画面は、Strutsフレームワークにおけるstruts-config.xmlに変換されている。
【0030】
次に、本実施の形態の動作について具体的に説明する。
図4は、本実施の形態の動作を示すフローチャートである。
【0031】
まず、画面解析処理部11は、画面解析情報記憶部12に記憶される画面解析情報の木構造を生成する(ステップ101)。
ここで、このステップにおける処理について、図5〜7を参照しながら具体例に説明する。例えば、ユーザより、図5の右側に示されたソースコード(図6、7の右側に示されたソースコードも同じ)が入力されたとする。
画面解析処理部11は、ソースコード内の画面定義部、操作仕様実装部を解析することで、画面定義、画面遷移定義、イベント定義を出力する。
【0032】
まず、画面解析処理部11は、図5に(1)として示すように、Visual Basicソースコードのフォーム、コントロールの定義部分から画面定義を抽出する。具体的には、中間ソースコードに、"frmRingi"を定義する<page>要素と、"frmLogin"を定義する<page>要素とを生成し、"frmLogin"を定義する<page>要素内に更に"cmdOK"を定義する<part>要素を生成する。
【0033】
次に、画面解析処理部11は、図5に(2)として示すように、Visual Basicソースコードからイベントハンドラを抽出する。具体的には、中間ソースコードに、"frmLogin.cmdOK_Click"を定義する<action>要素を生成する。
【0034】
また、画面解析処理部11は、図5に(3)として示すように、イベントソースとイベントハンドラとの接続を行う。具体的には、"frmLogin"を定義する<page>要素内に"toFrmLogin_cmdOK_Click"を<exit-port>要素として設ける共に、"frmLogin.cmdOK_Click"を定義する<action>要素内に"default"を<entry-port>要素として設け、これらの<exit-port>要素と<entry-port>要素とを<connection>要素にて接続する(右側の矢印)。また、"frmLogin"を定義する<page>要素内に<exit-port>要素として設けられた"toFrmLogin_cmdOK_Click"を、"cmdOK"を定義する<part>要素内にも<exit-port>要素として設ける(左側の矢印)。
【0035】
更に、画面解析処理部11は、図6に(4)として示すように、画面遷移定義の抽出を行う。具体的には、"frmRingi"を定義する<page>要素内に"fromFrmLogin"を<entry-port>要素として設けると共に、"frmLogin.cmdOK_Click"を定義する<action>要素内に"toFrmRingi"を<exit-port>要素として設け、これらの<entry-port>要素と<exit-port>要素とを<connection>要素にて接続する(矢印)。また、"frmLogin"を定義する<page>要素内に"default"を<entry-port>要素として設けると共に、"frmLogin.cmdOK_Click"を定義する<action>要素内に"toDefault"を<exit-port>要素として設け、これらの<entry-port>要素と<exit-port>要素とを<connection>要素にて接続する。
【0036】
また、画面解析処理部11は、図7に(5)として示すように、条件分岐と画面遷移の抽出を行う。具体的には、Visual Basicソースコードから抽出した条件分岐を、"frmLogin.cmdOK_Click"を定義する<action>要素内に<logic>要素として展開し、<action>要素内に<exit-port>要素として設けられた"toFrmRingi"および"toDefault"を<logic>要素内に<exit-port>要素として設ける(矢印)。
【0037】
図5〜7の右側に示されたソースコードは、以上のような処理により、中間ソースコードに変換される。
【0038】
再び図4に戻り、説明を続ける。
要素変換処理部13は、画面解析情報記憶部12に記憶された画面解析情報、即ち、木構造の中間ソースコードの中から次の要素を選択する(ステップ102)。選択すべき要素(選択要素)が存在しない場合(ステップ103でNO)、処理は終了するが、選択要素が存在する場合(ステップ103でYES)、選択要素に対する変換ルールが存在するかどうか判定する(ステップ104)。ここで変換ルールが存在すると判定された場合、要素変換処理部13は、変換ルールに規定された関連要素を収集し(ステップ105)、選択要素および関連要素を含む要素集合に対して変換ルールを適用し、新規アプリケーションリソーステンプレートとして出力する(ステップ106)。
【0039】
次に、要素配置処理部15が、選択要素に対する配置ルールが存在するかどうか判定する(ステップ107)。そして、配置ルールが存在すると判定された場合、選択要素に対して配置ルールを適用し、選択要素の配置位置を決定する(ステップ108)。尚、配置ルールは、1つのアプリケーションリソーステンプレートにつき1つの選択要素に対して定義されており、選択要素に対する配置ルールの決定は、即ち、アプリケーションリソーステンプレートのフレームワークにおける配置位置の決定を意味する。従って、ステップ106で出力された新規アプリケーションリソーステンプレートのフレームワークにおける配置位置がステップ108で決定され、結果として、新規アプリケーションリソーステンプレートがフレームワークに配置された新規プリケーションテンプレートが生成されることになる。
【0040】
ここで、ステップ103〜108における処理について、図8〜12を参照しながら具体例に説明する。
まず、要素変換処理部13で用いられる変換ルールおよび要素配置処理部15で用いられる配置ルールについて説明する。
図8は、変換・配置ルールの例である。変換ルールおよび配置ルールは、対象フレームワーク種別、各フレームワーク内でのリソース種別毎に定義される。図8は、Strutsフレームワークについての例である。従って、XFormsについては、その特性に応じた別の変換・配置ルールが存在する。また、Strutsフレームワークのリソース種別としては、JSP、CSS、Action Class、ActionForm Class、struts-config.xmlがあるが、ここでは、JSP、Action Class、struts-config.xmlについての変換・配置ルールのみを示している。尚、図8では、変換ルールと配置ルールとを同じテーブルで管理しているが、別々のテーブルで管理するようにしてもよい。その場合、配置ルールについては、変換要素ごとではなく、リソースごとに定義してもよい。そして、ステップ104〜106を選択要素ごとの処理とし、ステップ107、108はリソースごとの処理としてもよい。
【0041】
次に、図8に示された変換・配置ルールのうち、変換ルールを用いて具体的な中間ソースコードを変換する処理について説明する。尚、図4のフローチャートでは、全ての変換ルールを同時に適用することを前提としていたが、以下では、説明を分かり易くするため、リソースごとに変換ルールを適用することとする。
また、入力としては、図9の左側に示す中間ソースコード(図10、11の左側に示された中間ソースコードも同じ)が与えられるとする。尚、この中間ソースコードは、図5〜7の処理により生成された中間ソースコードである。図5〜7では、中間ソースコードを定義抽出のフェーズに分けて記述したが、抽出された各定義を統合すると図9〜11に示すような中間ソースコードとなる。中間ソースコードは、大きく分けて、<page>で始まり</page>で終わる<page>要素と、<action>で始まり</action>で終わる<action>要素とから構成される。図3の概念図で言えば、<page>要素は、画面定義に相当する部分であり、<action>要素は、画面遷移定義に相当する部分である。また、図3の概念図におけるイベント定義は、図9〜11の中間ソースコードでは、<page>要素と<action>要素とを接続する部分(<connection>要素)に相当する。
【0042】
まず、図9を参照して、中間ソースコードをJSPに変換する場合について説明する。
図8のJSP変換・配置ルールに<page>要素が変換要素として定義されているので、要素変換処理部13は、中間ソースコードの"frmRingi"を定義する<page>要素に着目する。また、図8のJSP変換・配置ルールに<page>要素に対する関連要素として<property>子要素、<entry-port>子要素、<exit-port>子要素、接続されている<action>要素が定義されているので、要素変換処理部13は、中間ソースコードからこれらに対応する要素を収集する。この場合、<entry-port>子要素、<property>子要素が収集される。そして、図8のJSP変換・配置ルールに変換後の要素として<html:form/>が定義されているので、要素変換処理部13は、"frmRingi"を定義する<page>要素、収集された<entry-port>子要素、<property>子要素を、<html:form/>要素に変換する。尚、図8においては、<entry-port>子要素、<property>子要素の変換結果の記述については省略してある。
【0043】
また、要素変換処理部13は、同様にして、中間ソースコードの"frmLogin"を定義する<page>要素に着目し、その関連要素として、<entry-port>子要素、<exit-port>子要素、<action>要素を収集する。そして、要素変換処理部13は、"frmLogin"を定義する<page>要素、収集された<entry-port>子要素、<exit-port>子要素、<action>要素を、<html:form/>要素に変換する。尚、図8においては、<entry-port>子要素、<exit-port>子要素の変換結果の記述については省略してある。
【0044】
更に、図8のJSP変換・配置ルールにclass属性がbuttonの<part>要素が変換要素として定義されているので、要素変換処理部13は、中間ソースコードの"cmdOK"を定義する<part>要素に着目する。また、図8のJSP変換・配置ルールにclass属性がbuttonの<part>要素に対する関連要素として<property>子要素、<exit-port>子要素が定義されているので、要素変換処理部13は、中間ソースコードからこれらに対応する要素を収集する。この場合、<exit-port>子要素が収集される。そして、図8のJSP変換・配置ルールに変換後の要素として<html:submit/>が定義されているので、要素変換処理部13は、"cmdOK"を定義する<part>要素、収集された<exit-port>子要素を、<html:submit/>要素に変換する。尚、図8においては、<exit-port>子要素の変換結果の記述については省略してある。
【0045】
次に、図10を参照して、中間ソースコードをAction Classに変換する場合について説明する。
図8のAction Class変換・配置ルールに<action>要素が変換要素として定義されているので、要素変換処理部13は、中間ソースコードの"frmLogin.cmdOK_Click"を定義する<action>要素に着目する。そして、図8のAction Class変換・配置ルールに<action>要素に対する関連要素が定義されておらず、変換後の要素としてJAVAクラスが定義されているので、要素変換処理部13は、"frmLogin.cmdOK_Click"を定義する<action>要素をJAVAクラスの記述に変換する。
【0046】
また、図8のAction Class変換・配置ルールに<choice>要素が変換要素として定義されているので、要素変換処理部13は、<choice>要素に着目する。また、図8のAction Class変換・配置ルールに<choice>要素に対する関連要素として<when-if>要素、<when-else>要素が定義されているので、要素変換処理部13は、中間ソースコードから<when-if>要素、<when-else>要素を収集する。そして、図8のAction Class変換・配置ルールに変換後の要素としてIfステートメントが定義されているので、要素変換処理部13は、<choice>要素をIfステートメントに変換する。
【0047】
更に、図8のAction Class変換・配置ルールに<exit-port>要素が変換要素として定義されているので、要素変換処理部13は、中間ソースコードの<exit-port>要素に着目する。そして、図8のAction Class変換・配置ルールに<exit-port>要素に対する関連要素が定義されておらず、変換後の要素として画面遷移先を決定するステートメントが定義されているので、要素変換処理部13は、<exit-port>要素を画面遷移先を決定するステートメントに変換する。
【0048】
続いて、図11を参照して、中間ソースコードをstruts-config.xmlに変換する場合について説明する。
まず、図8のstruts-config.xml変換・配置ルールにrootが変換要素として定義されており、それに対する変換後の要素として<struts-config/>が定義されているので、struts-config.xmlに<struts-config/>要素が記述される。
【0049】
次に、図8のstruts-config.xml変換・配置ルールに<page>要素が変換要素として定義されているので、要素変換処理部13は、中間ソースコードの"frmRingi"を定義する<page>要素に着目する。そして、図8のstruts-config.xml変換・配置ルールに<page>要素に対する関連要素が定義されておらず、変換後の要素として<form-bean/>が定義されているので、要素変換処理部13は、"frmRingi"を定義する<page>要素を<form-bean/>要素に変換する。
【0050】
また、要素変換処理部13は、同様にして、中間ソースコードの"frmLogin"を定義する<page>要素に着目し、この要素を<form-bean/>要素に変換する。
【0051】
更に、図8のstruts-config.xml変換・配置ルールに<action>要素が変換要素として定義されているので、要素変換処理部13は、"frmLogin.cmdOK_Click"を定義する<action>要素に着目する。また、図8のstruts-config.xml変換・配置ルールに、<action>要素に対する関連要素として、接続されている<page>要素が定義されているので、要素変換処理部13は、"frmLogin.cmdOK_Click"を定義する<action>要素に接続される<page>要素を収集する。この場合、"frmRingi"を定義する<page>要素、"frmLogin"を定義する<page>要素が収集される。そして、図8のstruts-config.xml変換・配置ルールに変換後の要素として<action/>が定義されているので、要素変換処理部13は、"frmLogin.cmdOK_Click"を定義する<action>要素、収集された"frmRingi"を定義する<page>要素、"frmLogin"を定義する<page>要素を、<action/>要素に変換する。
【0052】
また、図8のstruts-config.xml変換・配置ルールに<action>要素内の<exit-port>要素が変換要素として定義されているので、要素変換処理部13は、"frmLogin.cmdOK_Click"を定義する<action>要素内の"toFrmRingi"を定義する<exit-port>要素に着目する。そして、図8のstruts-config.xml変換・配置ルールに<action>要素内の<exit-port>要素に対する関連要素は定義されておらず、変換後の要素として<forward/>が定義されているので、要素変換処理部13は、"toFrmRingi"を定義する<exit-port>要素を<forward/>に変換する。
【0053】
更にまた、要素変換処理部13は、同様にして、"frmLogin.cmdOK_Click"を定義する<action>要素内の"toDefault"を定義する<exit-port>要素に着目し、この要素を<forward/>に変換する。
図9〜11の左側に示された中間ソースコードは、以上のような処理により、3つのリソース(JSP、Action Class、struts-config.xml)に変換される。
【0054】
次に、図8に示された変換・配置ルールのうち、配置ルールを用いてこれらの3つのリソースを配置する処理について説明する。尚、ここでは、便宜上、図8の要素ごとに定義された配置ルールを参照するが、実際の処理としては、リソースごとに定義された配置ルールを参照しても同様である。
【0055】
まず、Strutsフレームワークにおいて、JSPを配置する処理を説明する。
図8のJSP変換・配置ルールでは、配置ルールとして、location属性の位置という指定がなされている。従って、要素配置処理部15は、図12の中間ソースコードに示す"location"の指定に応じて配置位置を決定し、JSPをその決定された位置に配置する。尚、中間ソースコードにおける"location"の指定は、ユーザが付加することもできるが、ユーザから情報入力がない場合は、システムが保持するデフォルト値が設定される。
【0056】
次に、Strutsフレームワークにおいて、Action Classを配置する処理を説明する。
図8のAction Class変換・配置ルールでは、配置ルールとして、location属性の位置という指定がなされている。従って、要素配置処理部15は、JSPの場合と同様、中間ソースコードに示す"location"の指定に応じて配置位置を決定し、Action Classをその決定された位置に配置する。尚、中間ソースコードにおける"location"の指定は、ユーザが付加することもできるが、ユーザから情報入力がない場合は、システムが保持するデフォルト値が設定される。
【0057】
最後に、Strutsフレームワークにおいて、struts-config.xmlを配置する処理を説明する。
図8のstruts-config.xml変換・配置ルールでは、配置ルールとして、固定位置という指定がなされている。従って、要素配置処理部15は、struts-config.xmlを固定の位置に配置することを決定し、struts-config.xmlをその決定された位置に配置する。
【0058】
このように、本実施の形態では、既存アプリケーションのソースコードを、例えば、Strutsフレームワークにおける各リソースに変換している。仮に、既存アプリケーションのソースコードを独自のアプリケーション構造に変換することでターゲット環境での動作を保証したとすると、開発者はその独自のアプリケーション構造を習得する必要があり、開発者のスキルが追いつかなくなる事態が考えられる。これに対し、本実施の形態では、標準化されたフレームワークの利用を前提とした変換を行うため、開発者に新たなスキルの習得を要求しない。即ち、既存アプリケーションのソースコードを、フレームワークを利用することによる利点を減ずることなく、ターゲット環境で動作するように変換することを可能にしている。
また、既存アプリケーションのソースコードを解析して得られる画面解析情報は、ソースコードから抽出した各要素を細分化し、分離して保持するようにしている。これにより、既存アプリケーションのソースコードをターゲット環境における標準化されたフレームワークに適合させるための変換が柔軟に行えるようになる。
更に、変換・配置ルールは、複数のフレームワークに対して設け、その中から移行したいターゲット環境を選択できるようにしている。これにより、既存アプリケーションのソースコードを複数のフレームワークのうちの所望のものに適合するよう変換することを可能としている。
【0059】
【発明の効果】
このように、本発明によれば、既存アプリケーションのソースコードを、ターゲット環境における標準化されたフレームワークを利用することによる利点を減ずることなく、ターゲット環境で動作するように変換することが可能となる。
【図面の簡単な説明】
【図1】 本実施の形態の全体構成を示す図である。
【図2】 本実施の形態の画面解析処理部による処理内容を概念的に示す図である。
【図3】 本実施の形態の要素変換処理部による処理内容を概念的に示す図である。
【図4】 本実施の形態の処理動作を示すフローチャートである。
【図5】 本実施の形態によるVisual Basicソースコードから中間ソースコードへの変換についての説明をするための図である。
【図6】 本実施の形態によるVisual Basicソースコードから中間ソースコードへの変換についての説明をするための図である。
【図7】 本実施の形態によるVisual Basicソースコードから中間ソースコードへの変換についての説明をするための図である。
【図8】 本実施の形態で用いる変換・配置ルールの一例を示す図である。
【図9】 本実施の形態による中間ソースコードからStrutsフレームワークのリソースへの変換を説明するための図である。
【図10】 本実施の形態による中間ソースコードからStrutsフレームワークのリソースへの変換を説明するための図である。
【図11】 本実施の形態による中間ソースコードからStrutsフレームワークのリソースへの変換を説明するための図である。
【図12】 本実施の形態でリソースの配置位置を指定するlocation属性を説明するための図である。
【符号の説明】
10…既存アプリケーションソースコード記憶部、11…画面解析処理部、12…画面解析情報記憶部、13…要素変換処理部、14…新規アプリケーションリソーステンプレート記憶部、15…要素配置処理部、16…新規アプリケーションテンプレート記憶部
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a technique for converting a source code of an application program developed in the past (hereinafter simply referred to as “application”) so as to operate in an environment to be migrated (hereinafter referred to as “target environment”). The present invention relates to a source code conversion apparatus that converts source code so as to conform to a standardized framework in the environment.
[0002]
[Prior art]
Today, with the spread of the Java 2 Enterprise Edition (J2EE) environment, including WebSphere Application Server, there is an increasing demand to migrate existing applications developed in the past to run in the J2EE environment. Trademarks in the United States and other countries.) However, such existing applications are often developed in a language different from JAVA, which is a development language for applications operating in the J2EE environment, such as Visual Basic (JAVA and all JAVA-related trademarks and logos). Is a trademark or registered trademark of Sun Microsystems, Inc. in the United States and other countries.Visual Basic is a registered trademark of Microsoft Corp. in the United States and other countries.) In addition to the class library (for example, DB access) and the framework, the operation mode of the application is often different from the J2EE environment. For example, the existing application environment has a two-layer structure of a client in which application logic is arranged and a server in which data used by the application is arranged, whereas the J2EE environment mainly displays a screen. The difference is that it has a three-layer structure, such as a client to perform, an application server in which application logic is arranged, and a database server in which data used by the application is arranged. Therefore, it is not easy to migrate an existing application to the J2EE environment, and a large amount of man-hour is required for the work.
[0003]
Therefore, in order to support the migration of applications developed in the past to a new environment, conventionally, an existing system is analyzed and screen information necessary for building a new system is output (for example, see Patent Document 1). ), The existing system is analyzed, and interface information (screen definition information, screen operation information, screen transition information) of the new system is regenerated (for example, see Patent Document 2).
[0004]
[Patent Document 1]
JP 2001-027946 A (page 3-5, FIG. 2)
[Patent Document 2]
JP 2001-134423 A (page 2-4, FIG. 2)
[0005]
[Problems to be solved by the invention]
By the way, in recent years, the case of adopting a framework is increasing from the viewpoint of improving quality, productivity, and maintainability at the time of application migration. The framework is a framework for developing a Web application, and is for enabling one completed Web application to be efficiently developed by specifying unspecified details. Some frameworks, such as “Struts” developed by the “Jakarta Project” of the Apache Software Foundation, are rapidly gaining popularity and are used as standard.
[0006]
However, Patent Documents 1 and 2 only describe reducing interface information construction work in the new system by displaying interface information in the existing system, and conform to the Web application framework adopted in the new system. The interface information was not converted as is. That is, there is a problem in that the source code of the existing application cannot be converted to operate in the target environment without reducing the advantage of using the standardized framework in the target environment.
[0007]
The present invention has been made to solve the technical problems as described above, and its purpose is to reduce the advantages of using the standardized framework in the target environment for the source code of the existing application. Without converting it to work in the target environment.
Another object is to allow flexible conversion of existing application source code to conform to a standardized framework in the target environment.
Yet another object is to allow the source code of an existing application to be converted to fit a desired one of multiple frameworks.
[0008]
[Means for Solving the Problems]
For this purpose, the present invention converts the source code of an existing application into an application resource template in the target environment. That is, the source code conversion apparatus of the present invention analyzes the source code of the application program and generates analysis information (corresponding to the screen analysis information in FIG. 1) (corresponding to the screen analysis processing unit 11 in FIG. 1). By converting the analysis information generated by the analysis unit according to a predetermined conversion rule (conversion rule), the conversion unit (element conversion processing unit 13 in FIG. 1) generates an application resource template in a predetermined target environment. Correspondence).
[0009]
Further, in the present invention, the screen analysis information obtained by analyzing the source code of the existing application is configured to subdivide each element extracted from the source code, hold it separately. That is, in the source code conversion apparatus of the present invention, the analyzing means extracts a plurality of elements from the source code, separates each element, and includes it in the analysis information. In this case, the conversion rule defines the correspondence between the element or element set before conversion included in the analysis information and the element after conversion included in the application resource template, and the conversion means refers to the conversion rule, An element or an element set before conversion can be converted into a corresponding element after conversion. Also, a conversion rule may be provided corresponding to each of the plurality of target environments, and the conversion means may convert the analysis information according to the conversion rule corresponding to the requested target environment.
[0010]
On the other hand, the source code conversion apparatus of the present invention arranges application resource templates in a target environment according to a predetermined arrangement rule (arrangement rule), thereby generating an application template (element arrangement processing unit 15 in FIG. 1). Further).
[0011]
In addition, the placement rule defines the correspondence between the application resource template and the placement processing information for placing the application resource template in the target environment, the placement means refers to the placement rule, and uses the application resource template as the placement processing information. Based on the target environment. Furthermore, the arrangement means can also allow the user to specify the arrangement position when the arrangement processing information indicates that the user can specify the arrangement position of the application resource template in the target environment. Furthermore, an arrangement rule may be provided corresponding to each of the plurality of target environments, and the arrangement unit may arrange the application resource template according to the arrangement rule corresponding to the requested target environment.
[0012]
From another viewpoint, the source code conversion method of the present invention analyzes the source code of the application program to generate analysis information (corresponding to step 101 in FIG. 4), and the generated analysis information (FIG. 4). Step (corresponding to steps 104 to 106 in FIG. 4) by converting the screen analysis information in accordance with the conversion rule (conversion rule) stored in the storage device in advance to convert the application resource template in a predetermined target environment. And generating the application template by arranging the generated application resource template in the target environment according to the arrangement rule (arrangement rule) stored in the storage device in advance (corresponding to steps 107 and 108 in FIG. 4). Contains.
[0013]
In the step of generating analysis information, a plurality of elements are extracted from the source code, and an intermediate source code expressed by a tree structure by separating each element is stored as analysis information. In this case, in the step of generating the application resource template, the conversion rule that associates the element or element set before conversion with the element after conversion is read from the storage device, and the element or element before conversion in the conversion rule is read. The analysis information can be converted by converting the elements in the analysis information defined as a set into the corresponding converted elements. Also, in the step of generating the application resource template, a conversion rule corresponding to the requested target environment is read out from the plurality of conversion rules stored in the storage device, and the analysis information is converted according to the conversion rule. You can also.
[0014]
Further, in the step of generating an application template, an arrangement rule that associates each application resource template with arrangement processing information for arranging each application resource template in the target environment is read from the storage device, and the application resource template is associated. It is possible to arrange in the target environment based on the arrangement processing information. Furthermore, in the step of generating the application template, the arrangement rule corresponding to the requested target environment is read from the plurality of arrangement rules stored in the storage device, and the application resource template is arranged according to the arrangement rule. You can also.
[0015]
Here, the present invention can be grasped as a program for causing a computer to realize a predetermined function. That is, the program of the present invention has a function (corresponding to the screen analysis processing unit 11 in FIG. 1) for generating analysis information (corresponding to the screen analysis information in FIG. 1) by analyzing the source code of the application program in the computer. A function (corresponding to the element conversion processing unit 13 in FIG. 1) for generating an application resource template in a predetermined target environment by converting the generated analysis information in accordance with a conversion rule (conversion rule) stored in a storage device in advance. A function of generating the application template by arranging the generated application resource template in the target environment in accordance with an arrangement rule (arrangement rule) stored in the storage device in advance (corresponding to the element arrangement processing unit 15 in FIG. 1); make it happen.
[0016]
The analysis information generation function further realizes a function of extracting a plurality of elements from the source code, separating each element and expressing the intermediate source code expressed in a tree structure as analysis information. To do. In this case, the function for generating the application resource template is a function for reading a conversion rule corresponding to the requested target environment from among a plurality of conversion rules stored in the storage device and converting the analysis information according to the conversion rule. Can be further realized. In addition, the function for generating an application template further reads the arrangement rule corresponding to the requested target environment from the plurality of arrangement rules stored in the storage device, and further implements the function of arranging the application resource template according to the arrangement rule. It can also be made.
[0017]
DETAILED DESCRIPTION OF THE INVENTION
Hereinafter, the present invention will be described in detail based on embodiments shown in the accompanying drawings.
FIG. 1 is a block diagram showing the overall configuration of the present embodiment. As shown in FIG. 1, the present embodiment includes an existing application source code storage unit 10, a screen analysis processing unit 11, a screen analysis information storage unit 12, an element conversion processing unit 13, and a new application resource template storage unit. 14, an element arrangement processing unit 15, and a new application template storage unit 16.
[0018]
The existing application source code storage unit 10 is a part that stores source codes of existing applications developed in the past. An application is usually composed of a screen definition unit, an operation specification mounting unit, and a business specification mounting unit. In this embodiment, the screen analysis processing unit 11 analyzes only the screen definition unit and the operation specification mounting unit. Therefore, these two parts are indicated by a square box.
[0019]
The screen analysis processing unit 11 extracts only the screen definition, the screen transition definition, and the event definition from the screen definition unit and the operation specification implementation unit of the existing application source code stored in the existing application source code storage unit 10, and performs screen analysis. This is a part that generates information and stores it in the screen analysis information storage unit 12.
[0020]
The screen analysis information storage unit 12 is a part that stores the screen analysis information extracted by the screen analysis processing unit 11. Elements in the screen analysis information include screen definition, screen transition definition, and event definition. The elements in the screen definition include screen element definitions and screen element attributes. The elements in the screen transition definition include transition source screens, transition destination screens / states, transition conditions, and transition start events. Elements in the definition include an event source and an event type. The screen analysis information is held in a reusable intermediate format. For example, each element is held as source code (hereinafter referred to as “intermediate source code”) described in a tree structure such as an XML format. In this intermediate source code, the relationship between the elements is held in a parent-child relationship or a connection element, so that it is easy to collect elements necessary for element set conversion.
[0021]
The element conversion processing unit 13 inputs the screen analysis information from the screen analysis information storage unit 12, converts each element according to the conversion rule corresponding to the requested target environment type, and generates a new application resource template. This is the part that is output to the resource template storage unit 14. For example, if there are Struts and XForms as target environments that can be requested, a Struts conversion rule and an XForms conversion rule are prepared, and either one is selected and used according to the requested target environment.
[0022]
The new application resource template storage unit 14 is a part that stores the new application resource template generated by the element conversion processing unit 13. Here, the “application resource template” is a file required in the framework, and is also simply referred to as “resource” below. This includes, for example, screen resources, configuration files, source code, and the like.
[0023]
The element arrangement processing unit 15 arranges the application resource template stored in the new application resource template storage unit 14 according to the arrangement rule corresponding to the requested target environment type, generates a new application template, and generates a new application template storage unit. 16 is a part to be output. For example, if there are Struts and XForms as target environments that can be requested, a Struts placement rule and an XForms placement rule are prepared, and either one is selected and used according to the requested target environment. In addition, the default value is given about the arrangement | positioning information defined by these arrangement | positioning rules according to object Web application framework. In addition, arrangement information in the target Web application framework can be input by the user as needed and added to the screen analysis information.
[0024]
The new application template storage unit 16 is a part that stores the new application template generated by the element arrangement processing unit 15. Here, the “application template” is a resource arranged in the framework. For example, if there are Struts and XForms as target environments that can be requested, a new application template for Struts and a new application template for XForms can be generated.
[0025]
This embodiment is realized by a computer system. The hardware configuration of the computer system that realizes the present embodiment may be a general configuration including a central processing unit (CPU), a main storage device, an auxiliary storage device such as a hard disk device, an input device, and an output device.
In the auxiliary storage device, a program for realizing the screen analysis processing unit 11, the element conversion processing unit 13, and the element arrangement processing unit 15 is stored, and the CPU reads the program into the main storage device and executes the program, whereby the screen is displayed. An analysis processing unit 11, an element conversion processing unit 13, and an element arrangement processing unit 15 are realized. The auxiliary storage device also functions as the existing application source code storage unit 10, the new application resource template storage unit 14, and the new application template storage unit 16. Furthermore, the conversion rule used in the element conversion processing unit 13 and the arrangement rule used in the element arrangement processing unit 15 may be stored in the auxiliary storage device.
[0026]
Next, processing in the screen analysis processing unit 11 and the element conversion processing unit 13 will be described with reference to a conceptual diagram. Here, an example will be described in which an application developed in Visual Basic, which is often used as a development language for existing applications, is converted into resources of a Struts framework often used in a J2EE environment. However, the development language of the existing application is not limited to Visual Basic, and may be any language as long as it is different from the development language in the target environment. Further, the target environment is not limited to the Struts framework, and may be another environment such as XForms.
[0027]
First, processing when the screen analysis processing unit 11 converts each element of the application described in Visual Basic into each element of the screen analysis information will be described.
Since an application written in Visual Basic is event-driven, screen elements, event handlers, and elements in event handlers are tightly coupled. Therefore, it is not easy to convert the application structure as it is. Therefore, in this embodiment, each element of Visual Basic is subdivided and the connection between these elements is loosened and held. This realizes a flexible conversion mechanism to the Web application framework.
[0028]
FIG. 2 shows a specific state of conversion. In FIG. 2, each element in the application described in Visual Basic is shown on the left side, and each element in the screen analysis information is shown on the right side. In this conversion process, the screen definition in Visual Basic is converted to the screen definition in the screen analysis information (screen element definition, each screen element attribute), and the event handler in Visual Basic is the screen transition definition in the screen analysis information (transition source screen) , Transition destination screen / state, transition start event), and the start event in Visual Basic is converted to the event definition (event source, event type) in the screen analysis information.
[0029]
Next, processing when the element conversion processing unit 13 converts each element of the screen analysis information into a resource of the Web application framework will be described.
FIG. 3 shows a specific state of conversion. In FIG. 3, each element in the screen analysis information is shown on the left side, and resources in the Struts framework are shown on the right side. In this conversion processing, the screen definition in the screen analysis information is converted into JSP in the Struts framework, the screen transition definition in the screen analysis information is converted into an Action Class in the Struts framework, and the event definition and transition destination in the screen analysis information The screen is converted to struts-config.xml in the Struts framework.
[0030]
Next, the operation of the present embodiment will be specifically described.
FIG. 4 is a flowchart showing the operation of the present embodiment.
[0031]
First, the screen analysis processing unit 11 generates a tree structure of screen analysis information stored in the screen analysis information storage unit 12 (step 101).
Here, the process in this step will be described in a specific example with reference to FIGS. For example, suppose that the user inputs the source code shown on the right side of FIG. 5 (the same applies to the source code shown on the right side of FIGS. 6 and 7).
The screen analysis processing unit 11 outputs a screen definition, a screen transition definition, and an event definition by analyzing the screen definition unit and the operation specification implementation unit in the source code.
[0032]
First, as shown in FIG. 5 as (1), the screen analysis processing unit 11 extracts a screen definition from the form and control definition part of the Visual Basic source code. Specifically, "frmRingi" is defined in the intermediate source code Define <page> element and "frmLogin" Generate <page> element and define "frmLogin" Define "cmdOK" in the <page> element Generate <part> element.
[0033]
Next, the screen analysis processing unit 11 extracts an event handler from the Visual Basic source code, as shown as (2) in FIG. Specifically, define "frmLogin.cmdOK_Click" in the intermediate source code. Generate <action> element.
[0034]
Further, the screen analysis processing unit 11 connects the event source and the event handler as shown in FIG. 5 as (3). Specifically, define "frmLogin" Set "toFrmLogin_cmdOK_Click" in the <page> element Provide as <exit-port> element and define "frmLogin.cmdOK_Click""default" in the <action> element These are provided as <entry-port> elements. <exit-port> element and <entry-port> element and Connect with the <connection> element (right arrow). Also define "frmLogin" Within the <page> element Define "cmdOK" for "toFrmLogin_cmdOK_Click" provided as <exit-port> element Also in the <part> element Provided as an <exit-port> element (left arrow).
[0035]
Further, the screen analysis processing unit 11 extracts screen transition definitions as shown as (4) in FIG. Specifically, define "frmRingi""fromFrmLogin" in the <page> element Set as <entry-port> element and define "frmLogin.cmdOK_Click""toFrmRingi" in the <action> element Provide these as <exit-port> elements <entry-port> element and <exit-port> element and Connect with <connection> element (arrow). Also define "frmLogin""default" in the <page> element Set as <entry-port> element and define "frmLogin.cmdOK_Click" Set "toDefault" in the <action> element Provide these as <exit-port> elements <entry-port> element and <exit-port> element and Connect with the <connection> element.
[0036]
The screen analysis processing unit 11 extracts conditional branches and screen transitions as indicated by (5) in FIG. Specifically, "frmLogin.cmdOK_Click" is defined for the conditional branch extracted from the Visual Basic source code. Within the <action> element expands as a <logic> element, Within the <action> element Set "toFrmRingi" and "toDefault" provided as <exit-port> elements Within the <logic> element Provided as an <exit-port> element (arrow).
[0037]
The source code shown on the right side of FIGS. 5 to 7 is converted into intermediate source code by the processing as described above.
[0038]
Returning to FIG. 4 again, the description will be continued.
The element conversion processing unit 13 selects the next element from the screen analysis information stored in the screen analysis information storage unit 12, that is, the intermediate source code having a tree structure (step 102). If there is no element to be selected (selected element) (NO in step 103), the process ends. If there is a selected element (YES in step 103), it is determined whether a conversion rule for the selected element exists. (Step 104). If it is determined that the conversion rule exists, the element conversion processing unit 13 collects the related elements defined in the conversion rule (step 105), and sets the conversion rule for the element set including the selected element and the related element. Apply and output as a new application resource template (step 106).
[0039]
Next, the element arrangement processing unit 15 determines whether or not an arrangement rule for the selected element exists (step 107). If it is determined that an arrangement rule exists, the arrangement rule is applied to the selected element, and the arrangement position of the selected element is determined (step 108). An arrangement rule is defined for one selection element per application resource template, and determination of the arrangement rule for the selection element means determination of an arrangement position in the framework of the application resource template. Therefore, the arrangement position of the new application resource template output in step 106 in the framework is determined in step 108, and as a result, a new application template in which the new application resource template is arranged in the framework is generated. .
[0040]
Here, the processing in steps 103 to 108 will be described as a specific example with reference to FIGS.
First, the conversion rules used in the element conversion processing unit 13 and the arrangement rules used in the element arrangement processing unit 15 will be described.
FIG. 8 is an example of conversion / placement rules. The conversion rule and the arrangement rule are defined for each target framework type and each resource type within each framework. FIG. 8 is an example of the Struts framework. Therefore, for XForms, there is another conversion / placement rule according to its characteristics. The Struts framework resource types include JSP, CSS, Action Class, ActionForm Class, and struts-config.xml. Here, only conversion / placement rules for JSP, Action Class, and struts-config.xml are available. Is shown. In FIG. 8, the conversion rules and the placement rules are managed by the same table, but may be managed by separate tables. In this case, the arrangement rule may be defined for each resource instead of for each conversion element. Steps 104 to 106 may be processing for each selected element, and steps 107 and 108 may be processing for each resource.
[0041]
Next, processing for converting specific intermediate source code using the conversion rule out of the conversion / placement rules shown in FIG. 8 will be described. In the flowchart of FIG. 4, it is assumed that all the conversion rules are applied at the same time, but in the following, the conversion rules are applied for each resource to make the explanation easy to understand.
As an input, it is assumed that the intermediate source code shown on the left side of FIG. 9 (the same is true of the intermediate source code shown on the left side of FIGS. 10 and 11). This intermediate source code is the intermediate source code generated by the processing shown in FIGS. 5-7, the intermediate source code is described in the definition extraction phase. However, when the extracted definitions are integrated, the intermediate source code shown in FIGS. 9-11 is obtained. Intermediate source code can be broadly divided into starts with <page> ends with </ page> a <page> element, Start with <action> ends with </ action> It consists of an <action> element. In the conceptual diagram of FIG. <page> element is the part corresponding to screen definition, The <action> element is a part corresponding to the screen transition definition. Also, the event definition in the conceptual diagram of FIG. 3 is the intermediate source code of FIGS. <page> element and The part that connects the <action> element ( Corresponds to <connection> element.
[0042]
First, a case where intermediate source code is converted to JSP will be described with reference to FIG.
In the JSP conversion / placement rules in Figure 8 Since the <page> element is defined as a conversion element, the element conversion processing unit 13 defines "frmRingi" of the intermediate source code Focus on the <page> element. In addition, the JSP conversion / placement rules in FIG. As a related element to the <page> element <property> child element, <entry-port> child element, <exit-port> child element, connected Since the <action> element is defined, the element conversion processing unit 13 collects elements corresponding to these from the intermediate source code. in this case, <entry-port> child element, <property> child elements are collected. And as a converted element in the JSP conversion / placement rule of FIG. Since <html: form /> is defined, the element conversion processing unit 13 defines “frmRingi”. <page> element, collected <entry-port> child element, <property> child element Convert to <html: form /> element. In FIG. 8, <entry-port> child element, The description of the conversion result of the <property> child element is omitted.
[0043]
Similarly, the element conversion processing unit 13 defines “frmLogin” of the intermediate source code. Focus on the <page> element and its related elements are: <entry-port> child element, <exit-port> child element, Collect <action> elements. Then, the element conversion processing unit 13 defines “frmLogin”. <page> element, collected <entry-port> child element, <exit-port> child element, <action> element Convert to <html: form /> element. In FIG. 8, <entry-port> child element, The description of the conversion result of the <exit-port> child element is omitted.
[0044]
Furthermore, the class attribute is button in the JSP conversion / placement rule of FIG. Since the <part> element is defined as a conversion element, the element conversion processing unit 13 defines “cmdOK” of the intermediate source code. Focus on the <part> element. In the JSP conversion / placement rule of FIG. As a related element to the <part> element <property> child element, Since <exit-port> child elements are defined, the element conversion processing unit 13 collects elements corresponding to these from the intermediate source code. in this case, <exit-port> child elements are collected. And as a converted element in the JSP conversion / placement rule of FIG. Since <html: submit /> is defined, the element conversion processing unit 13 defines “cmdOK”. <part> element, collected <exit-port> child element Convert to <html: submit /> element. In FIG. 8, The description of the conversion result of the <exit-port> child element is omitted.
[0045]
Next, a case where intermediate source code is converted into Action Class will be described with reference to FIG.
In the Action Class conversion / placement rule in Figure 8 Since the <action> element is defined as a conversion element, the element conversion processing unit 13 defines “frmLogin.cmdOK_Click” of the intermediate source code. Focus on the <action> element. And in the Action Class conversion / placement rule of FIG. Since the related element for the <action> element is not defined and the JAVA class is defined as the element after conversion, the element conversion processing unit 13 defines “frmLogin.cmdOK_Click”. The <action> element is converted into a JAVA class description.
[0046]
In addition, the Action Class conversion / placement rules in FIG. Since the <choice> element is defined as a conversion element, the element conversion processing unit 13 Focus on the <choice> element. In addition, the Action Class conversion / placement rules in FIG. As a related element to the <choice> element <when-if> element, Since the <when-else> element is defined, the element conversion processing unit 13 starts from the intermediate source code. <when-if> element, Collect <when-else> elements. Since the If statement is defined as an element after conversion in the Action Class conversion / placement rule of FIG. 8, the element conversion processing unit 13 Convert the <choice> element to an If statement.
[0047]
Furthermore, the Action Class conversion / placement rules in FIG. Since the <exit-port> element is defined as a conversion element, the element conversion processing unit 13 uses the intermediate source code Focus on the <exit-port> element. And in the Action Class conversion / placement rule of FIG. Since the related element for the <exit-port> element is not defined and a statement for determining the screen transition destination is defined as the element after conversion, the element conversion processing unit 13 Convert the <exit-port> element into a statement that determines the screen transition destination.
[0048]
Next, a case where the intermediate source code is converted into struts-config.xml will be described with reference to FIG.
First, root is defined as a conversion element in the struts-config.xml conversion / placement rule in Fig. 8, and the converted element for that is <struts-config /> is defined, so in struts-config.xml <struts-config /> element is described.
[0049]
Next, the struts-config.xml conversion / placement rule in Figure 8 Since the <page> element is defined as a conversion element, the element conversion processing unit 13 defines "frmRingi" of the intermediate source code Focus on the <page> element. And in struts-config.xml conversion / placement rule of Fig.8 As the related element for <page> element is not defined and converted Since <form-bean /> is defined, the element conversion processing unit 13 defines "frmRingi"<page> element Convert to <form-bean /> element.
[0050]
Similarly, the element conversion processing unit 13 defines “frmLogin” of the intermediate source code. Focus on the <page> element. Convert to <form-bean /> element.
[0051]
Furthermore, the struts-config.xml conversion / placement rule in Fig. 8 Since the <action> element is defined as a conversion element, the element conversion processing unit 13 defines “frmLogin.cmdOK_Click”. Focus on the <action> element. In addition, the struts-config.xml conversion / placement rule in Fig. 8 Connected as a related element to the <action> element Since the <page> element is defined, the element conversion processing unit 13 defines “frmLogin.cmdOK_Click”. connected to the <action> element Collect <page> elements. In this case, define "frmRingi" Define <page> element, "frmLogin"<page> elements are collected. And, as an element after conversion to the struts-config.xml conversion / placement rule in Fig. 8 Since <action /> is defined, the element conversion processing unit 13 defines "frmLogin.cmdOK_Click"<action> element, defining the collected "frmRingi" Define <page> element, "frmLogin"<page> element Convert to <action /> element.
[0052]
In addition, the struts-config.xml conversion / placement rule in Figure 8 in the <action> element Since the <exit-port> element is defined as a conversion element, the element conversion processing unit 13 defines “frmLogin.cmdOK_Click”. Define "toFrmRingi" in <action> element Focus on the <exit-port> element. And in struts-config.xml conversion / placement rule of Fig.8 in the <action> element The related element for the <exit-port> element is not defined. Since <forward /> is defined, the element conversion processing unit 13 defines “toFrmRingi”. <exit-port> element Convert to <forward />.
[0053]
Furthermore, the element conversion processing unit 13 similarly defines “frmLogin.cmdOK_Click”. Define "toDefault" in <action> element Focus on the <exit-port> element and Convert to <forward />.
The intermediate source code shown on the left side of FIGS. 9 to 11 is converted into three resources (JSP, Action Class, struts-config.xml) by the process as described above.
[0054]
Next, a process of arranging these three resources using the placement rule among the conversion / placement rules shown in FIG. 8 will be described. Here, for the sake of convenience, the placement rules defined for each element in FIG. 8 are referred to for convenience. However, the actual processing is the same as referring to the placement rules defined for each resource.
[0055]
First, a process for placing a JSP in the Struts framework will be described.
In the JSP conversion / placement rule of FIG. 8, the location attribute location is designated as the placement rule. Therefore, the element arrangement processing unit 15 determines an arrangement position in accordance with the designation of “location” shown in the intermediate source code of FIG. 12, and arranges the JSP at the determined position. The designation of “location” in the intermediate source code can also be added by the user, but when there is no information input from the user, a default value held by the system is set.
[0056]
Next, processing for arranging Action Classes in the Struts framework will be described.
In the Action Class conversion / placement rule of FIG. 8, the location attribute location is designated as the placement rule. Therefore, as in the case of JSP, the element arrangement processing unit 15 decides the arrangement position in accordance with the designation of “location” shown in the intermediate source code, and arranges the Action Class at the determined position. The designation of “location” in the intermediate source code can also be added by the user, but when there is no information input from the user, a default value held by the system is set.
[0057]
Finally, a process for placing struts-config.xml in the Struts framework will be described.
In the struts-config.xml conversion / arrangement rule in FIG. 8, the fixed position is designated as the arrangement rule. Therefore, the element arrangement processing unit 15 decides to arrange struts-config.xml at a fixed position, and arranges struts-config.xml at the decided position.
[0058]
Thus, in this embodiment, the source code of the existing application is converted into each resource in the Struts framework, for example. If it is assumed that the operation in the target environment is guaranteed by converting the source code of the existing application into a unique application structure, the developer needs to learn the unique application structure, and the developer's skills cannot catch up. A situation is possible. On the other hand, in the present embodiment, conversion is performed on the premise that a standardized framework is used, so that the developer is not required to acquire new skills. That is, the source code of the existing application can be converted to operate in the target environment without reducing the advantage of using the framework.
Further, the screen analysis information obtained by analyzing the source code of the existing application is divided into individual elements extracted from the source code, separated and held. As a result, the conversion for adapting the source code of the existing application to the standardized framework in the target environment can be performed flexibly.
Furthermore, conversion / placement rules are provided for a plurality of frameworks, and a target environment to be migrated can be selected from among them. This makes it possible to convert the source code of an existing application so as to conform to a desired one of a plurality of frameworks.
[0059]
【The invention's effect】
As described above, according to the present invention, it is possible to convert the source code of an existing application so as to operate in the target environment without reducing the advantage of using the standardized framework in the target environment. .
[Brief description of the drawings]
FIG. 1 is a diagram showing an overall configuration of an embodiment.
FIG. 2 is a diagram conceptually showing processing contents by a screen analysis processing unit of the present embodiment.
FIG. 3 is a diagram conceptually showing the processing contents by an element conversion processing unit of the present embodiment.
FIG. 4 is a flowchart showing a processing operation of the present embodiment.
FIG. 5 is a diagram for describing conversion from Visual Basic source code to intermediate source code according to the present embodiment;
FIG. 6 is a diagram for describing conversion from Visual Basic source code to intermediate source code according to the present embodiment;
FIG. 7 is a diagram for explaining conversion from Visual Basic source code to intermediate source code according to the present embodiment;
FIG. 8 is a diagram showing an example of a conversion / placement rule used in the present embodiment.
FIG. 9 is a diagram for explaining conversion from intermediate source code to a Struts framework resource according to the present embodiment;
FIG. 10 is a diagram for explaining conversion from an intermediate source code to a Struts framework resource according to the present embodiment;
FIG. 11 is a diagram for explaining conversion from an intermediate source code to a Struts framework resource according to the present embodiment;
FIG. 12 is a diagram for explaining a location attribute for designating a resource arrangement position in the present embodiment.
[Explanation of symbols]
DESCRIPTION OF SYMBOLS 10 ... Existing application source code memory | storage part, 11 ... Screen analysis process part, 12 ... Screen analysis information storage part, 13 ... Element conversion process part, 14 ... New application resource template memory | storage part, 15 ... Element arrangement | positioning process part, 16 ... New Application template storage

Claims (18)

アプリケーションプログラムのソースコードを解析して、画面を定義する画面定義と、遷移元画面、遷移先画面、遷移条件を少なくとも定義する画面遷移定義と、画面遷移を起動するイベントを定義するイベント定義とを含む解析情報を生成する解析手段と、
前記解析手段により生成された前記解析情報に含まれる前記画面定義を予め定められた変換規則に従って変換することで、所定のフレームワークにおける第1のアプリケーションリソーステンプレートを生成し、当該解析情報に含まれる前記画面遷移定義を当該変換規則に従って変換することで、当該フレームワークにおける第2のアプリケーションリソーステンプレートを生成し、当該解析情報に含まれる前記イベント定義および前記画面遷移定義で定義された前記遷移先画面を当該変換規則に従って変換することで、当該フレームワークにおける第3のアプリケーションリソーステンプレートを生成する変換手段と
を備えたことを特徴とするソースコード変換装置。
Analyzing the source code of the application program, screen definition that defines the screen, transition source screen, transition destination screen, screen transition definition that defines at least the transition condition, and event definition that defines the event that triggers the screen transition Analysis means for generating analysis information including,
A first application resource template in a predetermined framework is generated by converting the screen definition included in the analysis information generated by the analysis unit according to a predetermined conversion rule, and is included in the analysis information The transition destination screen defined by the event definition and the screen transition definition included in the analysis information by generating the second application resource template in the framework by converting the screen transition definition according to the conversion rule A source code conversion apparatus comprising: conversion means for generating a third application resource template in the framework by converting the program according to the conversion rule.
前記解析手段は、前記ソースコードから前記画面定義と前記画面遷移定義と前記イベント定義とを抽出し、当該画面定義と当該画面遷移定義と当該イベント定義とを分離して前記解析情報に含めることを特徴とする請求項1記載のソースコード変換装置。  The analysis means extracts the screen definition, the screen transition definition, and the event definition from the source code, and separates the screen definition, the screen transition definition, and the event definition and includes them in the analysis information. 2. The source code conversion device according to claim 1, wherein 前記変換規則は、前記画面定義に含まれる第1の変換前の要素または要素集合と、前記第1のアプリケーションリソーステンプレートに含まれる第1の変換後の要素との対応、前記画面遷移定義に含まれる第2の変換前の要素または要素集合と、前記第2のアプリケーションリソーステンプレートに含まれる第2の変換後の要素との対応、および、前記イベント定義に含まれる第3の変換前の要素または要素集合と、前記第3のアプリケーションリソーステンプレートに含まれる第3の変換後の要素との対応を規定し、
前記変換手段は、前記変換規則を参照して、前記第1の変換前の要素または要素集合を前記第1の変換後の要素に変換し、前記第2の変換前の要素または要素集合を前記第2の変換後の要素に変換し、前記第3の変換前の要素または要素集合を前記第3の変換後の要素に変換することを特徴とする請求項2記載のソースコード変換装置。
The conversion rule includes a correspondence between an element or element set before the first conversion included in the screen definition and an element after the first conversion included in the first application resource template, and the screen transition definition. Corresponding to the second pre-conversion element or element set and the second post-conversion element included in the second application resource template, and the third pre-conversion element included in the event definition or Defining the correspondence between the element set and the third converted element included in the third application resource template;
The conversion means refers to the conversion rule, converts the element or element set before the first conversion into the element after the first conversion, and converts the element or element set before the second conversion to the element before the second conversion. 3. The source code conversion apparatus according to claim 2, wherein the source code conversion apparatus converts the element or element set before the third conversion into the element after the third conversion by converting the element into the element after the second conversion.
前記変換規則は、複数のフレームワークの各々に対応して設けられ、
前記変換手段は、前記画面定義と前記画面遷移定義と前記イベント定義とを、要求されたフレームワークに対応する前記変換規則に従って変換することを特徴とする請求項1記載のソースコード変換装置。
The conversion rule is provided corresponding to each of a plurality of frameworks,
The source code conversion apparatus according to claim 1, wherein the conversion unit converts the screen definition, the screen transition definition, and the event definition according to the conversion rule corresponding to the requested framework.
前記第1のアプリケーションリソーステンプレートと前記第2のアプリケーションリソーステンプレート前記第3のアプリケーションリソーステンプレートとを予め定められた配置規則に従って前記フレームワークに配置することで、アプリケーションテンプレートを生成する配置手段を更に備えたことを特徴とする請求項1記載のソースコード変換装置。Arrangement means for generating an application template by arranging the first application resource template, the second application resource template, and the third application resource template in the framework according to a predetermined arrangement rule. The source code conversion apparatus according to claim 1, further comprising: 前記配置規則は、前記第1のアプリケーションリソーステンプレートと、前記第1のアプリケーションリソーステンプレートを前記フレームワークに配置するための第1の配置処理情報との対応、前記第2のアプリケーションリソーステンプレートと、前記第2のアプリケーションリソーステンプレートを前記フレームワークに配置するための第2の配置処理情報との対応、および、前記第3のアプリケーションリソーステンプレートと、前記第3のアプリケーションリソーステンプレートを前記フレームワークに配置するための第3の配置処理情報との対応を規定し、
前記配置手段は、前記配置規則を参照して、前記第1のアプリケーションリソーステンプレートを前記第1の配置処理情報に基づいて前記フレームワークに配置し、前記第2のアプリケーションリソーステンプレートを前記第2の配置処理情報に基づいて当該フレームワークに配置し、前記第3のアプリケーションリソーステンプレートを前記第3の配置処理情報に基づいて当該フレームワークに配置することを特徴とする請求項5記載のソースコード変換装置。
The placement rule includes a correspondence between the first application resource template and first placement processing information for placing the first application resource template in the framework, the second application resource template, Correspondence with second arrangement processing information for arranging the second application resource template in the framework, and arranging the third application resource template and the third application resource template in the framework Prescribing the correspondence with the third arrangement processing information for
The placement unit refers to the placement rule, places the first application resource template in the framework based on the first placement processing information, and places the second application resource template in the second 6. The source code conversion according to claim 5, wherein the source code conversion is arranged in the framework based on arrangement processing information, and the third application resource template is arranged in the framework based on the third arrangement processing information. apparatus.
前記配置手段は、前記第1の配置処理情報、前記第2の配置処理情報、および、前記第3の配置処理情報の何れかが、前記フレームワークにおける前記第1のアプリケーションリソーステンプレート、前記第2のアプリケーションリソーステンプレート、および、前記第3のアプリケーションリソーステンプレートのうちの対応するアプリケーションリソーステンプレートの配置位置をユーザが指定可能なことを示す場合に、前記配置位置をユーザに指定させることを特徴とする請求項6記載のソースコード変換装置。  The placement unit is configured such that any one of the first placement processing information, the second placement processing information, and the third placement processing information is the first application resource template in the framework, the second placement processing information, and the second placement processing information. When the user can specify the arrangement position of the corresponding application resource template among the application resource template and the third application resource template, the user is allowed to specify the arrangement position. The source code conversion apparatus according to claim 6. 前記配置規則は、複数のフレームワークの各々に対応して設けられ、
前記配置手段は、前記第1のアプリケーションリソーステンプレートと前記第2のアプリケーションリソーステンプレート前記第3のアプリケーションリソーステンプレートとを、要求されたフレームワークに対応する前記配置規則に従って配置することを特徴とする請求項5記載のソースコード変換装置。
The arrangement rule is provided corresponding to each of a plurality of frameworks,
The arrangement means arranges the first application resource template, the second application resource template, and the third application resource template according to the arrangement rule corresponding to the requested framework. The source code conversion apparatus according to claim 5.
コンピュータが、アプリケーションプログラムのソースコードを解析して、画面を定義する画面定義と、遷移元画面、遷移先画面、遷移条件を少なくとも定義する画面遷移定義と、画面遷移を起動するイベントを定義するイベント定義とを含む解析情報を生成するステップと、
コンピュータが、生成された前記解析情報に含まれる前記画面定義を予め記憶装置に記憶された変換規則に従って変換することで、所定のフレームワークにおける第1のアプリケーションリソーステンプレートを生成し、当該解析情報に含まれる前記画面遷移定義を当該変換規則に従って変換することで、当該フレームワークにおける第2のアプリケーションリソーステンプレートを生成し、当該解析情報に含まれる前記イベント定義および前記画面遷移定義で定義された前記遷移先画面を当該変換規則に従って変換することで、当該フレームワークにおける第3のアプリケーションリソーステンプレートを生成するステップと、
コンピュータが、生成された前記第1のアプリケーションリソーステンプレートと前記第2のアプリケーションリソーステンプレート前記第3のアプリケーションリソーステンプレートとを予め記憶装置に記憶された配置規則に従って前記フレームワークに配置することで、アプリケーションテンプレートを生成するステップと
を含むことを特徴とするソースコード変換方法。
An event in which the computer analyzes the source code of the application program and defines the screen, the transition source screen, the transition destination screen, the screen transition definition that defines at least the transition condition, and the event that triggers the screen transition Generating analysis information including definitions;
A computer generates a first application resource template in a predetermined framework by converting the screen definition included in the generated analysis information in accordance with a conversion rule stored in advance in a storage device, and includes the analysis information in the analysis information. By converting the screen transition definition included according to the conversion rule, a second application resource template in the framework is generated, and the transition defined by the event definition and the screen transition definition included in the analysis information Generating a third application resource template in the framework by converting the previous screen according to the conversion rule;
The computer arranges the generated first application resource template, the second application resource template, and the third application resource template in the framework according to an arrangement rule stored in advance in a storage device, A source code conversion method comprising: generating an application template.
前記解析情報を生成するステップでは、前記ソースコードから前記画面定義と前記画面遷移定義と前記イベント定義とを抽出し、当該画面定義と当該画面遷移定義と当該イベント定義とを分離して木構造で表現した中間ソースコードを、前記解析情報として記憶することを特徴とする請求項9記載のソースコード変換方法。  In the step of generating the analysis information, the screen definition, the screen transition definition, and the event definition are extracted from the source code, and the screen definition, the screen transition definition, and the event definition are separated into a tree structure. The source code conversion method according to claim 9, wherein the expressed intermediate source code is stored as the analysis information. 前記第1のアプリケーションリソーステンプレートと前記第2のアプリケーションリソーステンプレートと前記第3のアプリケーションリソーステンプレートとを生成するステップでは、
前記画面定義に含まれる第1の変換前の要素または要素集合と前記第1のアプリケーションリソーステンプレートに含まれる第1の変換後の要素とを対応付け、前記画面遷移定義に含まれる第2の変換前の要素または要素集合と前記第2のアプリケーションリソーステンプレートに含まれる第2の変換後の要素とを対応付け、かつ、前記イベント定義に含まれる第3の変換前の要素または要素集合と前記第3のアプリケーションリソーステンプレートに含まれる第3の変換後の要素とを対応付けた前記変換規則を前記記憶装置から読み出し、
前記変換規則において前記第1の変換前の要素または要素集合として規定される前記画面定義内の要素を前記第1の変換後の要素に変換することで、前記画面定義を変換し、前記変換規則において前記第2の変換前の要素または要素集合として規定される前記画面遷移定義内の要素を前記第2の変換後の要素に変換することで、前記画面遷移定義を変換し、前記変換規則において前記第3の変換前の要素または要素集合として規定される前記イベント定義内の要素を前記第3の変換後の要素に変換することで、前記イベント定義を変換することを特徴とする請求項10記載のソースコード変換方法。
In the step of generating the first application resource template , the second application resource template, and the third application resource template ,
The second conversion included in the screen transition definition by associating the first pre-conversion element or element set included in the screen definition with the first converted element included in the first application resource template The previous element or element set is associated with the second converted element included in the second application resource template, and the third element or element set before conversion included in the event definition and the first Reading the conversion rule that associates the third converted element included in the application resource template of 3 from the storage device;
In the conversion rule, the screen definition is converted by converting an element in the screen definition specified as the element or element set before the first conversion into the element after the first conversion, and the conversion rule Converting the screen transition definition by converting the element in the screen transition definition defined as the element or element set before the second conversion into the element after the second conversion in the conversion rule, 11. The event definition is converted by converting an element in the event definition defined as an element or element set before the third conversion into an element after the third conversion. The source code conversion method described.
前記第1のアプリケーションリソーステンプレートと前記第2のアプリケーションリソーステンプレートと前記第3のアプリケーションリソーステンプレートとを生成するステップでは、前記記憶装置に記憶された複数の変換規則のうち、要求されたフレームワークに対応する変換規則を読み出し、前記画面定義と前記画面遷移定義と前記イベント定義とを当該変換規則に従って変換することを特徴とする請求項9記載のソースコード変換方法。In the step of generating the first application resource template , the second application resource template, and the third application resource template , a requested framework is selected from the plurality of conversion rules stored in the storage device. The source code conversion method according to claim 9, wherein a corresponding conversion rule is read, and the screen definition, the screen transition definition, and the event definition are converted according to the conversion rule. 前記アプリケーションテンプレートを生成するステップでは、
前記第1のアプリケーションリソーステンプレートと前記第1のアプリケーションリソーステンプレートを前記フレームワークに配置するための第1の配置処理情報とを対応付け、前記第2のアプリケーションリソーステンプレートと前記第2のアプリケーションリソーステンプレートを前記フレームワークに配置するための第2の配置処理情報とを対応付け、かつ、前記第3のアプリケーションリソーステンプレートと前記第3のアプリケーションリソーステンプレートを前記フレームワークに配置するための第3の配置処理情報とを対応付けた前記配置規則を前記記憶装置から読み出し、
前記第1のアプリケーションリソーステンプレートを前記第1の配置処理情報に基づいて前記フレームワークに配置し、前記第2のアプリケーションリソーステンプレートを前記第2の配置処理情報に基づいて前記フレームワークに配置し、前記第3のアプリケーションリソーステンプレートを前記第3の配置処理情報に基づいて前記フレームワークに配置することを特徴とする請求項9記載のソースコード変換方法。
In the step of generating the application template,
The first application resource template is associated with first arrangement processing information for arranging the first application resource template in the framework, and the second application resource template and the second application resource template are associated with each other. Is associated with the second arrangement processing information for arranging the third application resource template in the framework, and the third arrangement for arranging the third application resource template and the third application resource template in the framework. The arrangement rule that associates processing information is read from the storage device,
Placing the first application resource template in the framework based on the first placement processing information, placing the second application resource template in the framework based on the second placement processing information, The source code conversion method according to claim 9, wherein the third application resource template is placed in the framework based on the third placement processing information.
前記アプリケーションテンプレートを生成するステップでは、前記記憶装置に記憶された複数の配置規則のうち、要求されたフレームワークに対応する配置規則を読み出し、前記第1のアプリケーションリソーステンプレートと前記第2のアプリケーションリソーステンプレート前記第3のアプリケーションリソーステンプレートとを当該配置規則に従って配置することを特徴とする請求項9記載のソースコード変換方法。In the step of generating the application template, the arrangement rule corresponding to the requested framework is read out from the plurality of arrangement rules stored in the storage device, and the first application resource template and the second application resource are read out. 10. The source code conversion method according to claim 9, wherein the template and the third application resource template are arranged according to the arrangement rule. コンピュータに、
アプリケーションプログラムのソースコードを解析して、画面を定義する画面定義と、遷移元画面、遷移先画面、遷移条件を少なくとも定義する画面遷移定義と、画面遷移を起動するイベントを定義するイベント定義とを含む解析情報を生成する機能と、
生成された前記解析情報に含まれる前記画面定義を予め記憶装置に記憶された変換規則に従って変換することで、所定のフレームワークにおける第1のアプリケーションリソーステンプレートを生成し、当該解析情報に含まれる前記画面遷移定義を当該変換規則に従って変換することで、当該フレームワークにおける第2のアプリケーションリソーステンプレートを生成し、当該解析情報に含まれる前記イベント定義および前記画面遷移定義で定義された前記遷移先画面を当該変換規則に従って変換することで、当該フレームワークにおける第3のアプリケーションリソーステンプレートを生成する機能と、
生成された前記第1のアプリケーションリソーステンプレートと前記第2のアプリケーションリソーステンプレート前記第3のアプリケーションリソーステンプレートとを予め記憶装置に記憶された配置規則に従って前記フレームワークに配置することで、アプリケーションテンプレートを生成する機能と
を実現させるためのプログラム。
On the computer,
Analyzing the source code of the application program, screen definition that defines the screen, transition source screen, transition destination screen, screen transition definition that defines at least the transition condition, and event definition that defines the event that triggers the screen transition A function to generate analysis information including,
By converting the screen definition included in the generated analysis information in accordance with a conversion rule stored in advance in a storage device, a first application resource template in a predetermined framework is generated, and the analysis information included in the analysis information By converting the screen transition definition according to the conversion rule, a second application resource template in the framework is generated, and the transition destination screen defined by the event definition and the screen transition definition included in the analysis information is generated. A function of generating a third application resource template in the framework by converting according to the conversion rule;
By arranging the generated first application resource template, the second application resource template, and the third application resource template in the framework according to an arrangement rule stored in a storage device in advance, A program for realizing the functions to be generated.
前記解析情報を生成する機能では、前記ソースコードから前記画面定義と前記画面遷移定義と前記イベント定義とを抽出し、当該画面定義と当該画面遷移定義と当該イベント定義とを分離して木構造で表現した中間ソースコードを、前記解析情報として記憶する機能を更に実現させることを特徴とする請求項15記載のプログラム。  In the function for generating the analysis information, the screen definition, the screen transition definition, and the event definition are extracted from the source code, and the screen definition, the screen transition definition, and the event definition are separated into a tree structure. 16. The program according to claim 15, further realizing a function of storing the expressed intermediate source code as the analysis information. 前記第1のアプリケーションリソーステンプレートと前記第2のアプリケーションリソーステンプレートと前記第3のアプリケーションリソーステンプレートとを生成する機能では、前記記憶装置に記憶された複数の変換規則のうち、要求されたフレームワークに対応する変換規則を読み出し、前記画面定義と前記画面遷移定義と前記イベント定義とを当該変換規則に従って変換する機能を更に実現させることを特徴とする請求項15記載のプログラム。In the function of generating the first application resource template , the second application resource template, and the third application resource template , the requested framework is selected from the plurality of conversion rules stored in the storage device. The program according to claim 15, further comprising a function of reading a corresponding conversion rule and converting the screen definition, the screen transition definition, and the event definition according to the conversion rule. 前記アプリケーションテンプレートを生成する機能では、前記記憶装置に記憶された複数の配置規則のうち、要求されたフレームワークに対応する配置規則を読み出し、前記第1のアプリケーションリソーステンプレートと前記第2のアプリケーションリソーステンプレート前記第3のアプリケーションリソーステンプレートとを当該配置規則に従って配置する機能を更に実現させることを特徴とする請求項15記載のプログラム。In the function of generating the application template, the arrangement rule corresponding to the requested framework is read out from the plurality of arrangement rules stored in the storage device, and the first application resource template and the second application resource are read out. 16. The program according to claim 15, further realizing a function of arranging a template and the third application resource template according to the arrangement rule.
JP2003161029A 2003-06-05 2003-06-05 Source code conversion apparatus, source code conversion method, and program Expired - Fee Related JP4686117B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2003161029A JP4686117B2 (en) 2003-06-05 2003-06-05 Source code conversion apparatus, source code conversion method, and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2003161029A JP4686117B2 (en) 2003-06-05 2003-06-05 Source code conversion apparatus, source code conversion method, and program

Publications (2)

Publication Number Publication Date
JP2004362343A JP2004362343A (en) 2004-12-24
JP4686117B2 true JP4686117B2 (en) 2011-05-18

Family

ID=34053632

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003161029A Expired - Fee Related JP4686117B2 (en) 2003-06-05 2003-06-05 Source code conversion apparatus, source code conversion method, and program

Country Status (1)

Country Link
JP (1) JP4686117B2 (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5399601B2 (en) 2005-05-31 2014-01-29 日本電気株式会社 Implementation code development system and implementation code development program
JP2007087127A (en) * 2005-09-22 2007-04-05 Open Stream Inc Data generation program, storage medium for storing the program, open source software developmental environment integration program, and storage medium for storing the program
JP5593960B2 (en) * 2010-08-25 2014-09-24 株式会社リコー Business management system, business management server, and business management program
JP6123344B2 (en) * 2013-02-21 2017-05-10 日本電気株式会社 Screen program generating device, screen program generating method thereof, information processing device, and computer program
JP5405684B1 (en) * 2013-03-28 2014-02-05 株式会社バリュー Source program programming language converter
JP6111150B2 (en) * 2013-06-19 2017-04-05 株式会社エヌ・ティ・ティ・データ Source code analysis apparatus, source code analysis method, and program
JP7148804B2 (en) * 2019-02-15 2022-10-06 富士通株式会社 SOURCE FILE GENERATION PROGRAM, SOURCE FILE GENERATION METHOD, AND INFORMATION PROCESSING DEVICE

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002150377A (en) * 2000-11-10 2002-05-24 Japan Tobacco Inc Vending machine
JP2002182915A (en) * 2000-12-19 2002-06-28 Tokio Marine & Fire Insurance Co Ltd Source program storage method, its system, source program restoring method and system, and compiling method and device
JP2002366352A (en) * 2001-06-11 2002-12-20 It Forest Corp Apparatus for supporting web application development
JP2003076543A (en) * 2001-08-31 2003-03-14 Cats Kk Device, method for generating program and program for making computer execute the same program
JP2003150377A (en) * 2001-11-16 2003-05-23 Nec Corp System, method for developing picture output module, program, and recording medium
JP2004038297A (en) * 2002-06-28 2004-02-05 Jcreation Co Ltd Program format conversion apparatus and conversion program

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05134853A (en) * 1991-11-12 1993-06-01 Shikoku Nippon Denki Software Kk Program source language translating device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002150377A (en) * 2000-11-10 2002-05-24 Japan Tobacco Inc Vending machine
JP2002182915A (en) * 2000-12-19 2002-06-28 Tokio Marine & Fire Insurance Co Ltd Source program storage method, its system, source program restoring method and system, and compiling method and device
JP2002366352A (en) * 2001-06-11 2002-12-20 It Forest Corp Apparatus for supporting web application development
JP2003076543A (en) * 2001-08-31 2003-03-14 Cats Kk Device, method for generating program and program for making computer execute the same program
JP2003150377A (en) * 2001-11-16 2003-05-23 Nec Corp System, method for developing picture output module, program, and recording medium
JP2004038297A (en) * 2002-06-28 2004-02-05 Jcreation Co Ltd Program format conversion apparatus and conversion program

Also Published As

Publication number Publication date
JP2004362343A (en) 2004-12-24

Similar Documents

Publication Publication Date Title
KR100661393B1 (en) Web site management system and method applying web programming environment
EP2151773B1 (en) Synchronous to asynchronous web page conversion
US20060005132A1 (en) Smart UI recording and playback framework
CN108984172B (en) Interface file generation method and device
EP1139216A2 (en) Web application development system
US20050149868A1 (en) User interface application development program and development apparatus
JPWO2006137565A1 (en) Document processing apparatus and document processing method
US9817811B2 (en) Web server system, dictionary system, dictionary call method, screen control display method, and demonstration application generation method
US20020066074A1 (en) Method and system for developing and executing software applications at an abstract design level
US20070208995A1 (en) Document Processing Device and Document Processing Method
US20070198915A1 (en) Document Processing Device And Document Processing Method
JPWO2007081017A1 (en) Document processing device
KR101552914B1 (en) Web server application framework web application processing method using the framework and computer readable medium processing the method
JP4686117B2 (en) Source code conversion apparatus, source code conversion method, and program
Chakraborty et al. MVVM Demonstration Using C# WPF
JP2004046895A (en) Work flow conversion method
CN113296759A (en) User interface processing method, user interface processing system, user interface processing device, and storage medium
JP2001273125A (en) Method and system for automatically generating source program, and program recording medium therefor
JP2006236375A (en) Web application development method, development support system, and program about development method
JP2007094453A (en) Program development support system, program development support method and program
JP2010009145A (en) Web page creation system and web page creation program
Trivedi User interface implementation of environmental data integration system with React
JP4895374B2 (en) Software product generation method and system
Fraze-Frazenko et al. Panorama tours management application development
CN116974525A (en) Webpage generation method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20060517

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20090721

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20090924

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20100727

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20101020

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20110208

RD14 Notification of resignation of power of sub attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7434

Effective date: 20110208

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20110214

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20140218

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees