JP2007156761A - Design information generation device, program development system, design information generation method, program development method, and program - Google Patents
Design information generation device, program development system, design information generation method, program development method, and program Download PDFInfo
- Publication number
- JP2007156761A JP2007156761A JP2005350053A JP2005350053A JP2007156761A JP 2007156761 A JP2007156761 A JP 2007156761A JP 2005350053 A JP2005350053 A JP 2005350053A JP 2005350053 A JP2005350053 A JP 2005350053A JP 2007156761 A JP2007156761 A JP 2007156761A
- Authority
- JP
- Japan
- Prior art keywords
- information
- class
- storage area
- source code
- unit
- 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.)
- Withdrawn
Links
Images
Abstract
Description
本発明は、コンピュータを用いて、ソースコードからプログラムの設計情報を生成する設計情報生成装置、この設計情報生成装置を用いたプログラム開発システム、設計情報生成方法、プログラムに関するものである。 The present invention relates to a design information generation apparatus that generates design information of a program from source code using a computer, a program development system using the design information generation apparatus, a design information generation method, and a program.
あるプラットフォーム上のシステム(レガシーシステム)のソースコードを他のプラットフォーム上のシステムのソースコードに移植する方法に関して、従来、特許文献1に示されるようなクロスコンパイラを用いた手法が存在する。しかし、このような手法を用いた場合、移植時に生じやすい機能拡張、機能追加などのカスタマイズの要求に柔軟に応じることができない。したがって、現状では、人手でレガシーシステムのソースコードを解析して設計情報の抽出を行った上で移植作業を行うことが主流であり、そのために長い開発工期を要していた。
As a method for porting source code of a system on a certain platform (legacy system) to source code of a system on another platform, there is conventionally a technique using a cross compiler as disclosed in
ところで、プログラムの開発手法としてMDA(Model Driven Architecture)が注目されている。MDAは、プラットフォーム(特定のプログラミング環境)に依存せず、UMLなどの標準モデリング技法を使ってアプリケーションの機能をモデル化し、さらにそのモデル情報を基にソースコードを自動生成する開発手法である。MDAでは、まず実装技術から独立する形でビジネスプロセスを分析し、プラットフォームに依存しないモデルであるPIM(Platform Independent Model)を作成する。続いてPIMをベースにモデルコンパイラと呼ばれるツールを用いて個別プラットフォームに特化したモデルであるPSM(Platform Specific Model)を生成する。さらにPIMもしくはPSMの情報から、ソースコード生成ツールを使って実際のソースコードに変換して実装作業を進めていく。
しかしながら、MDAの開発手法においても、異なるプラットフォーム間でのソースコードの移植はやはり人手に依存している。すなわち、MDAでは、PSMからソースコードへの一方向の生成(変換)を可能とするものの、その逆のソースコードからPSMを生成する仕組みは実現されていないからである。 However, even in the MDA development method, porting of source code between different platforms still depends on manpower. That is, although MDA enables one-way generation (conversion) from PSM to source code, a mechanism for generating PSM from the opposite source code is not realized.
そこで本発明はこのような事情を鑑み、ソースコードからステレオタイプの情報が付与された設計情報を生成することができ、異なるプラットフォーム間でのソースコードの移植工期の短縮を図ることのできる設計情報生成装置、プログラム開発システム、設計情報生成方法、プログラム開発方法およびプログラムを提供しようとするものである。 Therefore, in view of such circumstances, the present invention can generate design information to which stereotype information is added from the source code, and can reduce the time required for porting the source code between different platforms. A generation apparatus, a program development system, a design information generation method, a program development method, and a program are provided.
上記の課題を解決するために、本発明の設計情報生成装置は、ソースコードを解析してクラスに関する情報、クラス間の関係に関する情報、変数に関する情報をそれぞれ抽出するソースコード解析部と、前記ソースコード解析部によって抽出された前記クラスに関する情報をクラス記憶領域に記憶するクラス記憶処理部と、前記ソースコード解析部によって抽出された前記クラス間の関係に関する情報を関係記憶領域に記憶する関係記憶処理部と、前記ソースコード解析部によって抽出された前記変数に関する情報を変数記憶領域に記憶する変数記憶処理部と、前記クラス記憶領域および前記関係記憶領域にそれぞれ記憶された情報をもとにクラスに付与するステレオタイプの情報を生成するための変換ルールが記憶された変換ルール記憶部と、前記クラス記憶領域および前記関係記憶領域にそれぞれ記憶された情報をもとに前記変換ルール記憶部に記憶された変換ルールに従ってステレオタイプの情報を生成し、前記クラス記憶領域の前記クラスに関する情報に対応付けて記憶するステレオタイプ情報付与部と、前記クラス記憶領域に記憶され前記ステレオタイプの情報が付与された前記クラスに関する情報、前記関係記憶領域に記憶された前記クラス間の関係に関する情報、および前記変数記憶領域に記憶された前記変数に関する情報をプログラムの設計情報として、この設計情報に対応するクラス図を作成するクラス図作成部とを具備するものである。 In order to solve the above-described problems, a design information generation apparatus according to the present invention analyzes a source code to extract information on classes, information on relationships between classes, and information on variables, and the source A class storage processing unit that stores information on the class extracted by the code analysis unit in a class storage area, and a relationship storage process that stores information on the relationship between the classes extracted by the source code analysis unit in the relation storage area A variable storage processing unit for storing information about the variable extracted by the source code analysis unit in a variable storage area, and a class based on information stored in the class storage area and the relation storage area, respectively. Conversion rule storage unit storing conversion rules for generating stereotype information to be given Generating stereotype information according to the conversion rules stored in the conversion rule storage unit based on the information stored in the class storage area and the relation storage area, respectively. A stereotype information assigning unit for storing the information in association with each other, information on the class stored in the class storage area and provided with the stereotype information, information on the relationship between the classes stored in the relation storage area, and A class diagram creating unit that creates information about the variables stored in the variable storage area as program design information and creates a class diagram corresponding to the design information.
この発明によれば、ソースコードから、クラスにステレオタイプの情報が付与された設計情報を生成することができる。また、生成された設計情報からクラス図を作成して、たとえば設計者に掲示することができる。 According to the present invention, design information in which stereotype information is assigned to a class can be generated from the source code. Also, a class diagram can be created from the generated design information and posted to a designer, for example.
また、本発明の設計情報生成装置は、前記クラス図作成部により作成された前記クラス図を参照した設計者からの入力をもとに、前記クラス記憶領域に記憶されたステレオタイプの情報を補正するモデル補正部をさらに具備するものであってもよい。 The design information generation apparatus of the present invention corrects stereotype information stored in the class storage area based on an input from a designer who refers to the class diagram created by the class diagram creation unit. It may further comprise a model correction unit.
また、本発明の別の観点に基づくプログラム開発システムは、上記の設計情報生成装置と、この設計情報生成装置にて生成された前記プログラムの設計情報を、プラットフォームに依存しない設計情報に変換する第1のモデルコンパイラと、この第1のモデルコンパイラによって得られた設計情報に対して設計者によってカスタマイズされた結果を特定プラットフォームに依存する設計情報に変換する第2のモデルコンパイラと、この第2のモデルコンパイラによって得られた特定プラットフォームに依存する設計情報からソースコードを生成するソースコード生成部とを具備するものである。 According to another aspect of the present invention, there is provided a program development system for converting the design information generation apparatus described above and design information of the program generated by the design information generation apparatus into design information independent of a platform. A first model compiler, a second model compiler that converts a result customized by the designer to design information obtained by the first model compiler into design information that depends on a specific platform, and the second model compiler. A source code generation unit that generates source code from design information dependent on a specific platform obtained by the model compiler.
この発明によれば、異なるプラットフォーム間でのソースコードの移植を行う際に、プラットフォームに依存しない設計情報のレベルで必要なカスタマイズを行うことができるので、異なるプラットフォーム間でのソースコードの移植工期の短縮を図ることができる。 According to the present invention, when source code is transplanted between different platforms, necessary customization can be performed at the level of design information that does not depend on the platform. Shortening can be achieved.
本発明によれば、ソースコードからステレオタイプの情報が付与された設計情報を生成することができ、異なるプラットフォーム間でのソースコードの移植工期の短縮を図ることができる。 ADVANTAGE OF THE INVENTION According to this invention, the design information to which the stereotype information was provided from the source code can be produced | generated, and the shortening of the construction period of the source code between different platforms can be aimed at.
以下、本発明の実施の形態を図面を用いて説明する。 Hereinafter, embodiments of the present invention will be described with reference to the drawings.
図1は本発明の一実施形態にかかる設計情報生成装置を採用したプログラム開発システムの構成を示す図である。 FIG. 1 is a diagram showing a configuration of a program development system that employs a design information generation apparatus according to an embodiment of the present invention.
本実施形態の設計情報生成装置およびプログラム開発システムは、たとえば、プログラムを実行するCPU(Central Processing Unit)、ROM(Read Only Memory)、実行中のプログラムやデータなどを記憶するメインメモリであるRAM(Random Access Memory)、プログラムやデータを蓄積するメモリ記憶装置やハードディスクドライブなどの記憶装置、キーボードやマウスなどの入力装置、および表示装置などで構成される複数のコンピュータ、あるいは、このようなコンピュータを、通信回線を通じて有機的に複数接続して構成されるサーバ/クライアント方式のネットワークシステムによって実現される。以下、生成部などの「部」の用語は、プログラムの特定の部分をCPUが実行することによって実現される機能を意味する。また、「クラス記憶領域」などの「記憶領域」の用語は、メモリ記憶装置やハードディスクドライブなどの記憶装置に確保された記憶領域を意味する。また、「変換ルール定義ファイル」などの「ファイル」はハードディスクドライブなどの記憶装置に記憶され、必要に応じてメモリ記憶装置にロードされることによってCPUによってアクセスされる。 The design information generation apparatus and the program development system of the present embodiment include, for example, a central processing unit (CPU) that executes a program, a read only memory (ROM), and a RAM (main memory that stores a program and data being executed). Random Access Memory), a memory storage device for storing programs and data, a storage device such as a hard disk drive, an input device such as a keyboard and a mouse, and a display device, or such a computer, This is realized by a server / client system network system configured by a plurality of organic connections through communication lines. Hereinafter, the term “unit” such as a generation unit means a function realized by a CPU executing a specific part of a program. The term “storage area” such as “class storage area” means a storage area secured in a storage device such as a memory storage device or a hard disk drive. Also, “files” such as “conversion rule definition file” are stored in a storage device such as a hard disk drive, and are loaded into the memory storage device as needed to be accessed by the CPU.
図1に示すように、この実施形態のプログラム開発システム100は、プラットフォーム(特定のプログラミング環境)に依存せず、UMLなどの標準モデリング技法を使ってアプリケーションの機能をモデル化し、さらにそのモデル情報を基にソースコードを自動生成する開発手法であるMDA200(MDA:Model Driven Architecture)と、設計情報生成装置300とで構成される。
As shown in FIG. 1, the program development system 100 of this embodiment does not depend on a platform (specific programming environment), models a function of an application using a standard modeling technique such as UML, and further stores the model information. It is composed of an MDA 200 (MDA: Model Driven Architecture) which is a development method for automatically generating source code based on the design
MDA200では、まず実装技術から独立する形でビジネスプロセスを分析してプラットフォームに依存しないモデルである設計情報(以下「PIM」と記述)(PIM:Platform Independent Model)11を作成し、続いてPIM11をベースに、モデルコンパイラ12によって個別プラットフォームに特化した設計情報(以下「PSM」と記述)(PSM:Platform Specific Model)13に変換し、このPSM13をベースにソースコード生成部19にてソースコード15を生成する。 The MDA 200 first analyzes the business process in a manner independent of the mounting technology and creates design information (hereinafter referred to as “PIM”) 11 (PIM: Platform Independent Model) 11 that is a platform-independent model. Based on this, the model compiler 12 converts the information into design information (hereinafter referred to as “PSM”) 13 (PSM: Platform Specific Model) 13 that is specialized for an individual platform. Is generated.
モデルコンパイラ12は、本発明の構成の第2のモデルコンパイラに相当するPIM/PSM変換部12aと本発明の構成の第1のモデルコンパイラに相当するPSM/PIM変換部12bを有する。第2のモデルコンパイラであるPIM/PSM変換部12aは、PIM11をPSM13に変換する機能である。第1のモデルコンパイラであるPSM/PIM変換部12bは、PSM13,14をPIM11に変換する機能である。すなわち、MDA200でのPIM11からPSM13への変換はモデルコンパイラ12のPIM/PSM変換部12aを用いて行われる。
The model compiler 12 includes a PIM /
設計情報生成装置300は、その主要部であるモデル抽出装置16と、モデル抽出装置16への入力である特定プラットフォームに特化したソースコード17と、変換ルール定義ファイル18と、モデル抽出装置16の成果物であるPSM14とで構成される。
The design
モデル抽出装置16は、特定プラットフォームに特化したソースコード17から変換ルール定義ファイル18を用いて、プログラムの設計情報であるPSM14を生成する装置である。生成されたPSM14はモデルコンパイラ12のPSM/PIM変換部12bによってPIM11へと変換される。
The
図2はモデル抽出装置16の構成を説明するためのデータフローおよび機能ブロックである。
FIG. 2 is a data flow and functional blocks for explaining the configuration of the
モデル抽出装置16は、ソースコード解析部21、クラス記憶処理部22、関係記憶処理部23、変数記憶処理部24、ステレオタイプ情報付与部25、クラス図作成部26を情報処理部として備えている。また、モデル抽出装置16は、モデル抽出の処理に用いられる記憶領域として、クラス記憶領域27、関係記憶領域28、および変数記憶領域29をもつ。
The
ソースコード解析部21は、ソースコード17を読み込んで解析し、クラス、クラス間の関係に関する情報、変数に関する情報を抽出して、クラス記憶処理部22、関係記憶処理部23、変数記憶処理部24にこれらの情報を出力する。クラス記憶処理部22は、クラス記憶領域27に対する書き込み、読み込み、検索を行う。関係記憶処理部23は、関係記憶領域28に対する書き込み、読み込み、検索を行う。変数記憶処理部24は、変数記憶領域29に対する書き込み、読み込み、検索を行う。
The source
ステレオタイプ情報付与部25は、クラス記憶領域27および関係記憶領域28に記憶された情報と変換ルール定義ファイル18の変換ルールとをもとに、クラス記憶領域27に記憶されたクラスの情報に付加するステレオタイプの情報を生成する。
The stereotype
クラス図作成部26は、クラス記憶領域27、関係記憶領域28、および変数記憶領域29にそれぞれ記憶された情報をもとにPSMのクラス図を作成して、ユーザ31のためのディスプレイ30に表示する。
The class
次に、モデル抽出の処理に用いられる記憶領域である、クラス記憶領域27、関係記憶領域28、および変数記憶領域29に記憶される情報の構成を説明する。
Next, the configuration of information stored in the
図3にクラス記憶領域27に記憶されるクラスに関する情報の構成を示す図である。同図に示すように、クラス記憶領域27に記憶されるクラスに関する情報は、クラスID、クラス名、ステレオタイプの項目からなる。ここで、クラスIDはソースコードに現れる全てのクラスを識別するための情報である。クラス名はクラスIDで識別される各々のクラスの名前(名称)である。ステレオタイプとは、UMLの機能の一つで、クラスの役割や用法上の違いなどをモデル要素に修飾するために用いられる情報である。クラスの役割や用法上の違いは同一のモデル要素でも発生し得ることから、ステレオタイプによってこのような違いを表記することができる。
FIG. 3 is a diagram showing a configuration of information related to classes stored in the
図4は関係記憶領域28に記憶されるクラス間の関係に関する情報の構成を示す図である。同図に示すように、関係記憶領域28に記憶されるクラス間の関係に関する情報は、クライアントクラスID、サプライヤクラスID、関係の項目で構成されている。ここで関係とは、クライアントクラスIDおよびサプライヤクラスIDで示される2つのクラス間の関係である。関係の種類には、‘関連’、‘集約’、‘依存’、‘継承’、‘実現’がある。クライアントクラスとは、メッセージを送る側のクラスであり、サプライヤクラスはメッセージを受け取るクラスである。
FIG. 4 is a diagram showing the configuration of information related to the relationship between classes stored in the
図5は変数記憶領域29に記憶される変数に関する情報の構成を示す図である。同図に示すように、変数記憶領域29に記憶される変数に関する情報は、フィールド変数が所属するクラスのクラスID、フィールド変数名、フィールド変数のクラスのクラスIDからなる。ここで変数とは、クラスのフィールド変数である。
FIG. 5 is a diagram showing a configuration of information regarding variables stored in the
次に、変換ルール定義ファイル18の変換ルールについて説明する。
Next, the conversion rule of the conversion
図6に変換ルールをまとめた表を示す。このように変換ルールには、
・ルール1:処理対象のクラスが‘ActionListener’であって関係記憶領域28のサプライヤクラスIDに記憶されており、関係が‘実現’である場合、クライアントIDのクラスに<<Controller>>のステレオタイプを付与する。ステレオタイプはクラス記憶領域27に記臆される。
FIG. 6 shows a table summarizing the conversion rules. In this way, conversion rules include
Rule 1: If the class to be processed is “ActionListener” and is stored in the supplier class ID of the
・ルール2:処理対象のクラスが‘JFrame’であって関係記憶領域28のサプライヤクラスIDに記憶されており、関係が‘継承’である場合、クライアントIDのクラスに<<View>>のステレオタイプを付与する。ステレオタイプはクラス記憶領域27に記憶される。
Rule 2: If the class to be processed is 'JFrame' and is stored in the supplier class ID of the
・ルール3:処理対象のクラスが関係記憶領域のサプライヤクラスIDに記憶されており、関係が‘実現’である場合、処理対象クラスに<<interface>>のステレオタイプを付与する。ステレオタイプはクラス記憶領域27に記憶される。
Rule 3: If the class to be processed is stored in the supplier class ID of the relation storage area and the relation is 'realization', the stereotype << interface >> is assigned to the class to be processed. The stereotype is stored in the
・ルール4:処理対象のクラスがjavaとjavaxで始まるパッケージに含まれる場合、処理対象のクラスにステレオタイプは付けない。 Rule 4: If the class to be processed is included in a package beginning with java and javax, the stereotype is not attached to the class to be processed.
・ルール5:処理対象のクラスがルール1から4のどれにも当てはまらず、ステレオタイプがついていない場合、処理対象のクラスに<<Model>>のステレオタイプを付与する。ステレオタイプはクラス記憶領域に記憶する。
Rule 5: If the class to be processed does not correspond to any of the
次に、本実施形態の設計情報生成装置300の動作を説明する。
Next, the operation of the design
図7は本実施形態の設計情報生成装置300の全体的な動作を示すシーケンス図である。
FIG. 7 is a sequence diagram showing the overall operation of the design
1:ユーザ31は、図示しない入力装置を用いて、ソースコード解析部21に対してソースコード17のモデル化を指示する。
1: The
2:ソースコード解析部21は、この指示に従ってソースコード17を解析し、クラス、関係、変数に関する情報をそれぞれ抽出して、クラス記憶処理部22、関係記憶処理部23、変数記憶処理部24にわたす。クラス記憶処理部22、関係記憶処理部23、変数記憶処理部24はソースコード解析部21から受け取った情報を、クラス記憶領域27、関係記憶領域28、および変数記憶領域29に記憶する。なお、このときの動作については、図8を用いて後で詳細に説明する。
2: The source
3:ソースコード解析部21は、ステレオタイプ情報付与部25に対してステレオタイプの情報の付与を指示する。
3: The source
4:ステレオタイプ情報付与部25は、この指示を受けると、クラス記憶領域27および関係記憶領域28に記憶された情報と変換ルール定義ファイル18の変換ルールとをもとに、クラス記憶領域27に記憶されたクラスに関する情報にそれぞれ付加するステレオタイプの情報を生成してこれらの付与を行う。なお、このときの動作については、図15を用いて後で詳細に説明する。
4: Upon receiving this instruction, the stereotype
5:ステレオタイプ情報付与部25は、クラス図作成部26に対してクラス図の作成を指示する。
5: The stereotype
6:クラス図作成部26は、クラス記憶領域27、関係記憶領域28、および変数記憶領域29にそれぞれ記憶された情報をもとに、ステレオタイプの情報の付与されたPSMのクラス図を作成する。このクラス図作成部26の処理の詳細は後で説明する。
6: The class
7:クラス図作成部26は、作成したクラス図の表示をディスプレイ30に指示する。
7: The class
8:ディスプレイ30は、クラス図作成部26より与えられたクラス図を表示する。
8: The
次に、上記のソースコード解析の動作の詳細を説明する。 Next, details of the operation of the source code analysis will be described.
図8はこのソースコード解析の動作に関するシーケンス図である。なお、動作の理解を助けるために、具体的なソースコードを前提にして説明を行う。図9、図10、図11はその具体的なソースコードの例であるJava(登録商標)のソースコードの抜粋を示している。また、これらのソースコードとシーケンス図との関係が分かるように、シーケンス図における個々の処理が対象とするソースコードの行に、シーケンス図における処理の番号を符号として付してある。 FIG. 8 is a sequence diagram relating to the operation of the source code analysis. In order to help understanding of the operation, description will be made on the assumption of specific source code. 9, FIG. 10 and FIG. 11 show excerpts of Java (registered trademark) source code, which is an example of the specific source code. Further, in order to understand the relationship between these source codes and the sequence diagram, the number of the process in the sequence diagram is attached as a code to the line of the source code targeted by each process in the sequence diagram.
1:ユーザ31は、図示しない入力装置を用いて、ソースコード解析部21に対してソースコード17のモデル化を指示する。
1: The
2:ソースコード解析部21は、このモデル化の指示に従ってソースコード17を読み込む。
2: The source
3:ソースコード解析部21は、読み込んだソースコード17のクラス宣言を読み込む。
3: The source
3.1:ソースコード解析部21は、ソースコード17からクラスXの名前(クラス名)を抽出するとともに、このクラスXに対してID(クラスID)を付与する。そしてソースコード解析部21は、そのクラスXのクラス名とクラスIDをクラス記憶処理部22を通じてクラス記憶領域27に記憶する。図9ないし図11のソースコードの例では、Counter、CounterListener、CounterViewなどのクラス名が抽出されてそれぞれにクラスIDが付与される。
3.1: The source
3.2:ソースコード解析部21は、スーパークラスの解析を行う。
3.2: The source
3.2.1:ソースコード解析部21は、クラスXのスーパークラスYの名前(クラス名)を抽出するとともに、このスーパークラスYにID(クラスID)を付与する。そしてソースコード解析部21は、そのスーパークラスのクラス名とクラスIDをクラス記憶処理部22を通じてクラス記憶領域27に記憶する。たとえば、CounterViewのクラスのスーパークラスの名前としてJFrameが抽出され、これにクラスIDが付与される。
3.2.1: The source
3.2.2:ソースコード解析部21は、クラスXとスーパークラスYの各クラスIDおよびそのクラス間の関係を関係記憶処理部23を通じて関係記憶領域28に記憶する。この場合のクラス間の関係は一意に継承となる。ここで、クラスXのクラスIDはクライアントクラスIDとして、スーパークラスYのクラスIDはサプライヤクラスIDとして関係記憶領域28に記憶される。
3.2.2: The source
3.3:ソースコード解析部21は、インターフェースの解析を行う。
3.3: The source
3.3.1:ソースコード解析部21は、クラスXのインターフェースZの名前(クラス名)を抽出するとともに、このインターフェースZにID(クラスID)を付与する。そしてソースコード解析部21は、そのインターフェースZのクラス名とクラスIDをクラス記憶処理部22を通じてクラス記憶領域27に記憶する。
3.3.1: The source
3.3.2:ソースコード解析部21は、クラスXとインターフェースZの各クラスIDおよびそのクラス間の関係を関係記憶処理部23を通じて関係記憶領域28に記憶する。この場合の関係は一意に実現となる。ここで、クラスXのクラスIDはクライアントクラスIDとして、インターフェースZのクラスIDはサプライヤクラスIDとして関係記憶領域28に記憶される。
3.3.2: The source
3.4:ソースコード解析部21は、クラス宣言のクラス本体の解析を行う。
3.4: The source
3.4.1:ソースコード解析部21は、クラス宣言のクラス本体の解析結果からフィールド(図9ないし図11の符号3.4.1の各行)の解析を行う。
3.4.1: The source
3.4.1.1:ソースコード解析部21は、フィールドの解析結果からフィールド変数のクラスWの名前(クラス名)を抽出するとともに、そのクラスWにID(クラスID)を付与する。そして、ソースコード解析部21は、そのフィールド変数のクラスWのクラス名とクラスIDをクラス記憶処理部22を通じてクラス記憶領域27に記憶する。
3.4.1.1: The source
3.4.1.2:ソースコード解析部21は、フィールド変数の変数名aとそのフィールド変数のクラスWのクラスID、所属クラスXのIDを、変数に関する情報として変数記憶処理部24を通じて変数記憶領域29に記憶する。
3.4.1.2: The source
3.4.1.3:ソースコード解析部21は、所属クラスXとフィールド変数のクラスWの各クラスIDおよびそのクラス間の関係を関係記憶処理部23を通じて関係記憶領域28に記憶する。この場合の関係は一意に集約となる。
3.4.1.3: The source
3.4.2:ソースコード解析部21は、メソッド宣言の解析を行う。
3.4.2: The source
3.4.2.1:ソースコード解析部21は、結果型のクラスUの名前(クラス名)を抽出し
、このクラスUにID(クラスID)を付与する。そして、ソースコード解析部21は、その結果型のクラスUのクラス名とクラスIDを、クラス記憶処理部22を通じてクラス記憶領域27に記憶する。
3.4.2.1: The source
3.4.2.2:ソースコード解析部21は、その結果型のクラスUと所属クラスXの各クラスIDおよびその関係を関係記憶処理部23を通じて関係記憶領域28に記憶する。この場合の関係は一意に依存となる。ここで、結果型のクラスUのクラスIDはクライアントクラスIDとして、所属クラスXのクラスIDはサプライヤクラスIDとして関係記憶領域28に記憶される。
3.4.2.2: The source
3.4.3:ソースコード解析部21は、メソッド本体の解析を行う。
3.4.3: The source
3.4.3.1:ソースコード解析部21は、メソッド本体の解析結果からブロックで利用されているローカル変数のクラスVの名前(クラス名)を抽出するとともに、このローカル変数のクラスVにID(クラスID)を付与する。そしてソースコード解析部21は、そのローカル変数のクラスVのクラス名とクラスIDをクラス記憶処理部22を通じてクラス記憶領域27に記憶する。
3.4.3.1: The source
3.4.3.2:ソースコード解析部21は、所属クラスXとローカル変数のクラスVの各IDおよびそのクラス間の関係を関係記憶処理部23を通じて関係記憶領域28に記憶する。この場合の関係は一意に依存となる。ここで、ローカル変数のクラスVのクラスIDはクライアントクラスIDとして、所属クラスXのクラスIDはサプライヤクラスIDとして関係記憶領域28に記憶される。
3.4.3.2: The source
以上により、クラス記憶領域27、関係記憶領域28、および変数記憶領域29に、ソースコード17の解析によって得られた情報がそれぞれ記憶される。
As described above, the information obtained by analyzing the
図12は図9ないし図11のソースコードを含むソースコード17から上記の解析によってクラス記憶領域27に記憶されたクラスに関する情報の例である。このように、ソースコード17に記述されている全てのクラスのクラスIDおよびクラス名がクラス記憶領域27に記憶される。ステレオタイプ情報の項目は全て空欄である。
FIG. 12 is an example of information on classes stored in the
図13は同じくそのソースコード17から上記の解析によって関係記憶領域28に記憶されたクラス間の関係に関する情報の例を示す。このように、ソースコード17に記述されている全てのクラス間の関係(関連、集約、依存、継承、実現など)が関係記憶領域28に記憶される。
FIG. 13 also shows an example of information related to the relationship between classes stored in the
図14は同じくそのソースコード17から上記の解析によって変数記憶領域29に記憶されたフィールド変数に関する情報の例を示す。このように、ソースコード17に記述されている全てのフィールド変数などが関係記憶領域28に記憶される。
FIG. 14 also shows an example of information relating to field variables stored in the
次に、ステレオタイプ情報の付与に関する動作の詳細を説明する。 Next, details of the operation relating to the provision of stereotype information will be described.
図15はこのステレオタイプ情報の付与の動作に関するシーケンス図である。 FIG. 15 is a sequence diagram relating to the operation of adding stereotype information.
1:ステレオタイプ情報付与部25は、ソースコード解析部21からステレオタイプの情報の付与の指示を受け取る。
1: The stereotype
1.1:ステレオタイプ情報付与部25は、このステレオタイプの情報の付与の指示を受け取ると、変換ルール定義ファイル18を読み込む。
1.1: Upon receiving this stereotype information addition instruction, the stereotype
1.2:ステレオタイプ情報付与部25は、読み込んだ変換ルール定義ファイル18に記述された変換ルール(図6)に従って、クラス記憶領域27(図12)に記憶された全てのクラスに対して付与するステレオタイプ情報を判定するための処理を開始する。
1.2: Stereotype
1.2.1:まず、ステレオタイプ情報付与部25は、クラス記憶領域27に記憶されている全てのクラスのクラスIDとクラス名との対応関係を読み込む。
1.2.1: First, the stereotype
1.2.2:ステレオタイプ情報付与部25は、関係記憶領域28(図13)に記憶されている全ての、関係するクラスの組み合わせであるクライアントクラスIDとサプライヤクラスIDとの組み合わせ、およびこれらのクラス間の関係を読み込む。
1.2.2: Stereotype
1.2.3:ステレオタイプ情報付与部25は、以上読み込んだ変換ルール、クラスIDとクラス名との対応関係、関係するクラスの組み合わせおよびその関係をもとに、ステレオタイプ情報を付与する対象のクラスとその付与すべきステレオタイプ情報を決定する。
1.2.3: The stereotype
1.2.3.1:ステレオタイプ情報付与部25は、決定したステレオタイプ情報を該当するクラスと対応付けてクラス記憶領域27に記憶する。
1.2.3.1: The stereotype
1.3:ステレオタイプ情報付与部25は、必要なクラスに対するステレオタイプ情報の付与が全て完了したところで、クラス図作成部26に対してクラス図の作成を指示する。
1.3: The stereotype
図16はクラス記憶領域27にステレオタイプ情報が付与された結果を示す図である。ここで、同図に示すステレオタイプ情報が具体的にどのように決定されたのかを説明する。
FIG. 16 is a diagram showing a result of adding stereotype information to the
クラス記憶領域27の1行目のクラスに付与されたステレオタイプ<<View>>は、図6に示した変換ルールの中のルール2に基づくものである。関係記憶領域28に記憶されている情報においてルール2の条件に合致するものは1行目の情報であり、ルール2の作用をもとに、クラスIDが0のCounterViewのクラスに対して<<View>>のステレオタイプが付与される。
The stereotype << View >> assigned to the class in the first row of the
クラス記憶領域27の3行目のクラスに付与されたステレオタイプ<<Model>>は、図6に示した変換ルールの中のルール5に基づくものである。
The stereotype << Model >> assigned to the class in the third row of the
クラス記憶領域27の9行目のクラスに付与されたステレオタイプ<<Controller>>は、図6に示した変換ルールの中のルール1に基づくものである。
The stereotype << Controller >> assigned to the class in the ninth line of the
クラス記憶領域27の10行目のクラスに付与されたステレオタイプ<<interface>>は、図6に示した変換ルールの中のルール3に基づくものである。関係記憶領域28に記憶されている情報においてルール3の条件に合致するものは9行目の情報であり、ルール3の作用をもとに、クラスIDが9のActionListenerのクラスに<<interface>>のステレオタイプ情報が付与される。
The stereotype << interface >> assigned to the class in the 10th line of the
また、クラス記憶領域27の2行目、4−8行目、11行目のクラスにはステレオタイプ情報が付与されていない。これは図6に示した変換ルールの中のルール4に基づく結果である。
Further, stereotype information is not given to the classes in the second, fourth to eighth, and eleventh lines of the
次に、クラス図作成部26によるクラス図の作成・表示処理について説明する。
Next, class diagram creation / display processing by the class
図17はこのクラス図の作成・表示処理に関するシーケンス図である。 FIG. 17 is a sequence diagram relating to the creation / display processing of this class diagram.
1:ステレオタイプ情報付与部25よりクラス図の作成の指示がクラス図作成部26に与えられる。
1: An instruction to create a class diagram is given from the stereotype
1.1:クラス図作成部26は、ステレオタイプ情報付与部25よりクラス図の作成の指示を受けると、クラス記憶領域27から各クラスIDごとのクラス名とステレオタイプ情報を読み込む。
1.1: Upon receiving an instruction to create a class diagram from the stereotype
1.2:クラス図作成部26は、変数記憶領域29からクラスIDごとのフィールド変数名を読み込む。
1.2: The class
1.3:クラス図作成部26は、ここまで読み込んだクラス名、ステレオタイプ情報、フィールド変数名から、クラス間の関係線を除くクラス図を作成する。
1.3: The class
1.3.1:クラス図作成部26は、作成されたクラス間の関係線を除くクラス図の表示をディスプレイ30に指示する。
1.3.1: The class
2:続いてクラス図作成部26は、関係記憶領域28から関係するクラスIDの組み合わせ(クライアントクラスIDとサプライヤクラスID)とその関係を読み込む。
2: Subsequently, the class
3:クラス図作成部26は、関係記憶領域28から読み込んだクラスID(クライアントクラスIDとサプライヤクラスID)に対応するクラス名をクラス記憶領域27から読み込む。
3: The class
4:クラス図作成部26は、2:と3:で読み込んだ情報をもとにクラス間の関係線を作成する。
4: The class
4.1:クラス図作成部26は、作成したクラス間の関係線の表示をディスプレイ30に指示する。
4.1: The class
図18は作成されたクラス図の例である。 FIG. 18 is an example of the created class diagram.
ここで、(7−1)から(7−11)はクラス、(7−12)から(7−21)は関係線である。クラスの表記は上段、中段、下段からなる。たとえば、ActionListenerのクラス(7−10)を例にとると符号33は上段、34は中段、35は下段である。上段にはクラス名とステレオタイプが記述され、ステレオタイプはクラス名の上に記述される。中段にはフィールド変数(属性)が記述される(図では省略)。下段にはメソッド(操作)が記述される(図では省略)。クラス間の関係線は線種と末端の形状によって関係の種類が表現されている。
Here, (7-1) to (7-11) are classes, and (7-12) to (7-21) are relationship lines. Class notation consists of upper, middle and lower levels. For example, taking the ActionListener class (7-10) as an example,
図19に図18のクラス図におけるクラスとクラス記憶領域27の情報との対応関係を、また、図20に図18のクラス図における関係線と関係記憶領域28の情報との対応関係をそれぞれ示す。
FIG. 19 shows the correspondence between the class in the class diagram of FIG. 18 and the information in the
以上説明したように、本実施形態の設計情報生成装置300によれば、特定プラットフォームに特化したソースコード17から、クラスにステレオタイプの情報が付与された設計情報を生成することができる。また、生成された設計情報からクラス図を作成して、設計者に掲示することができる。さらに、本実施形態のプログラム開発システム100によれば、異なるプラットフォーム間でのソースコードの移植を行う際に、プラットフォームに依存しない設計情報のレベルで必要なカスタマイズを行うことができるので、異なるプラットフォーム間でのソースコードの移植工期の短縮を図ることができる。
As described above, according to the design
次に、本発明の第2の実施形態である設計情報生成装置におけるモデル抽出装置116の構成を説明するためのデータフローおよび機能ブロックである。 Next, it is a data flow and functional block for demonstrating the structure of the model extraction apparatus 116 in the design information generation apparatus which is the 2nd Embodiment of this invention.
図21は第2の実施形態である設計情報生成装置におけるモデル抽出装置116の構成を説明するためのデータフローおよび機能ブロックである。 FIG. 21 is a data flow and functional blocks for explaining the configuration of the model extraction device 116 in the design information generation device according to the second embodiment.
本実施形態におけるモデル抽出装置116は、図2に示した第1の実施形態のモデル抽出装置16にモデル補正部41を付加したものである。
The model extraction device 116 in this embodiment is obtained by adding a
このモデル補正部41は、クラス図作成部26によってディスプレイ30に表示されたクラス図を参照したユーザ31から入力部を通じて入力された修正命令を受けて、その修正内容をクラス記憶処理部22、関係記憶処理部23、変数記憶処理部24を通じてクラス記憶領域27、関係記憶領域28、変数記憶領域29の情報に反映させるための手段である。クラス記憶領域27、関係記憶領域28、変数記憶領域29のそれぞれ修正内容は、クラス図作成部26によって、ディスプレイ30に表示されたクラス図に反映される。
The
図22は図18のクラス図の補正例を示す図である。この補正例では、(7−3)のCounterのクラスにステレオタイプとして<<Model>>のみが付与されていたが、ユーザ31の判断で、これに加えて、<<Service>>のステレオタイプ情報を付与した結果を示している。
FIG. 22 is a diagram showing a correction example of the class diagram of FIG. In this correction example, only << Model >> is assigned as the stereotype to the Counter class of (7-3), but in addition to the stereotype of << Service >> as determined by the
なお、本発明は、上述の実施形態にのみ限定されるものではなく、本発明の要旨を逸脱しない範囲内において種々更新を加え得ることは勿論である。 It should be noted that the present invention is not limited to the above-described embodiment, and it is needless to say that various updates can be added without departing from the gist of the present invention.
12…モデルコンパイラ、12a…PIM/PSM変換部、12b…PSM/PIM変換部、16…モデル抽出装置、18…変換ルール定義ファイル、19…ソースコード生成部、21…ソースコード解析部、22…クラス記憶処理部、23…関係記憶処理部、24…変数記憶処理部、25…ステレオタイプ情報付与部、26…クラス図作成部、27…クラス記憶領域、28…関係記憶領域、29…変数記憶領域、41…モデル補正部、100…プログラム開発システム、116…モデル抽出装置、300…設計情報生成装置。
DESCRIPTION OF SYMBOLS 12 ... Model compiler, 12a ... PIM / PSM conversion part, 12b ... PSM / PIM conversion part, 16 ... Model extraction apparatus, 18 ... Conversion rule definition file, 19 ... Source code generation part, 21 ... Source code analysis part, 22 ... Class storage processing unit, 23... Relationship storage processing unit, 24... Variable storage processing unit, 25... Stereotype information adding unit, 26.
Claims (8)
前記ソースコード解析部によって抽出された前記クラスに関する情報をクラス記憶領域に記憶するクラス記憶処理部と、
前記ソースコード解析部によって抽出された前記クラス間の関係に関する情報を関係記憶領域に記憶する関係記憶処理部と、
前記ソースコード解析部によって抽出された前記変数に関する情報を変数記憶領域に記憶する変数記憶処理部と、
前記クラス記憶領域および前記関係記憶領域にそれぞれ記憶された情報をもとにクラスに付与するステレオタイプの情報を生成するための変換ルールが記憶された変換ルール記憶部と、
前記変換ルール記憶部に記憶された変換ルールに従ってステレオタイプの情報を生成し、前記クラス記憶領域前記クラスに関する情報に対応付けて記憶するステレオタイプ情報付与部と、
前記クラス記憶領域に記憶され前記ステレオタイプの情報が付与された前記クラスに関する情報、前記関係記憶領域に記憶された前記クラス間の関係に関する情報、および前記変数記憶領域に記憶された前記変数に関する情報をプログラムの設計情報として、この設計情報に対応するクラス図を作成するクラス図作成部と
を具備することを特徴とする設計情報生成装置。 A source code analysis unit that analyzes source code and extracts information about classes, information about relationships between classes, and information about variables,
A class storage processing unit that stores information on the class extracted by the source code analysis unit in a class storage area;
A relationship storage processing unit that stores information on the relationship between the classes extracted by the source code analysis unit in a relationship storage area;
A variable storage processing unit that stores information on the variable extracted by the source code analysis unit in a variable storage area;
A conversion rule storage unit that stores conversion rules for generating stereotype information to be given to a class based on information stored in the class storage area and the relation storage area;
Generating stereotype information according to the conversion rules stored in the conversion rule storage unit, and storing the stereotype information in association with the class storage area information related to the class;
Information related to the class stored in the class storage area and provided with the stereotype information, information related to the relationship between the classes stored in the relation storage area, and information related to the variable stored in the variable storage area And a class diagram creation unit for creating a class diagram corresponding to the design information.
この設計情報生成装置にて生成された前記プログラムの設計情報を、プラットフォームに依存しない設計情報に変換する第1のモデルコンパイラと、
この第1のモデルコンパイラによって得られた設計情報に対して設計者によってカスタマイズされた結果を特定プラットフォームに依存する設計情報に変換する第2のモデルコンパイラと、
この第2のモデルコンパイラによって得られた特定プラットフォームに依存する設計情報からソースコードを生成するソースコード生成部と
を具備することを特徴とするプログラム開発システム。 A design information generating apparatus according to claim 1;
A first model compiler that converts design information of the program generated by the design information generation device into platform-independent design information;
A second model compiler that converts a result customized by the designer with respect to the design information obtained by the first model compiler into design information that depends on a specific platform;
A program development system comprising: a source code generation unit configured to generate a source code from design information dependent on a specific platform obtained by the second model compiler.
前記ソースコード解析部によって抽出された前記クラスに関する情報をクラス記憶領域に記憶するステップと、
前記ソースコード解析部によって抽出された前記クラス間の関係に関する情報を関係記憶領域に記憶するステップと、
前記ソースコード解析部によって抽出された前記変数に関する情報を変数記憶領域に記憶するステップと、
ステレオタイプ情報付与部にて、前記クラス記憶領域および前記関係記憶領域にそれぞれ記憶された情報をもとに予め決められた変換ルールに従ってステレオタイプの情報を生成し、前記クラス記憶領域の前記クラスに関する情報に対応付けて記憶するステップと、
前記クラス図作成部にて、前記クラス記憶領域に記憶され前記ステレオタイプの情報が付与された前記クラスに関する情報、前記関係記憶領域に記憶された前記クラス間の関係に関する情報、および前記変数記憶領域に記憶された前記変数に関する情報をプログラムの設計情報として、この設計情報に対応するクラス図を作成するステップと
を具備することを特徴とする設計情報生成方法。 A step of analyzing the source code by the source code analysis unit to extract information on classes, information on relationships between classes, and information on variables;
Storing information on the class extracted by the source code analysis unit in a class storage area;
Storing information on the relationship between the classes extracted by the source code analysis unit in a relationship storage area;
Storing information on the variable extracted by the source code analysis unit in a variable storage area;
The stereotype information adding unit generates stereotype information according to a predetermined conversion rule based on information stored in the class storage area and the relation storage area, and relates to the class in the class storage area. Storing in association with information;
In the class diagram creation unit, information on the class stored in the class storage area and provided with the stereotype information, information on the relationship between the classes stored in the relation storage area, and the variable storage area And a step of creating a class diagram corresponding to the design information using the information on the variables stored in the program as design information of the program.
前記第1のモデルコンパイラによって得られた設計情報に対して設計者によってカスタマイズされた結果を、第2のモデルコンパイラにて特定プラットフォームに依存する設計情報に変換するステップと、
ソースコード生成部にて、前記第2のモデルコンパイラによって得られた特定プラットフォームに依存する設計情報からソースコードを生成するステップと
を具備することを特徴とするプログラム開発方法。 Converting the design information of the program generated by the design information generation method of claim 4 into design information independent of a platform by a first model compiler;
Converting a result customized by a designer with respect to the design information obtained by the first model compiler into design information depending on a specific platform by the second model compiler;
Generating a source code from design information depending on a specific platform obtained by the second model compiler in a source code generation unit.
ソースコードを解析してクラスに関する情報、クラス間の関係に関する情報、変数に関する情報をそれぞれ抽出するソースコード解析部と、
前記ソースコード解析部によって抽出された前記クラスに関する情報をクラス記憶領域に記憶するクラス記憶処理部と、
前記ソースコード解析部によって抽出された前記クラス間の関係に関する情報を関係記憶領域に記憶する関係記憶処理部と、
前記ソースコード解析部によって抽出された前記変数に関する情報を変数記憶領域に記憶する変数記憶処理部と、
前記クラス記憶領域および前記関係記憶領域にそれぞれ記憶された情報をもとにクラスに付与するステレオタイプの情報を生成するための変換ルールが記憶された変換ルール記憶部と、
前記クラス記憶領域および前記関係記憶領域にそれぞれ記憶された情報をもとに前記変換ルール記憶部に記憶された変換ルールに従ってステレオタイプの情報を生成し、前記クラス記憶領域の前記クラスに関する情報に対応付けて記憶するステレオタイプ情報付与部と、
前記クラス記憶領域に記憶され前記ステレオタイプの情報が付与された前記クラスに関する情報、前記関係記憶領域に記憶された前記クラス間の関係に関する情報、および前記変数記憶領域に記憶された前記変数に関する情報をプログラムの設計情報として、この設計情報に対応するクラス図を作成するクラス図作成部と
して機能させることを特徴とするプログラム。 Computer
A source code analysis unit that analyzes the source code and extracts information about classes, information about relationships between classes, and information about variables,
A class storage processing unit that stores information on the class extracted by the source code analysis unit in a class storage area;
A relationship storage processing unit that stores information on the relationship between the classes extracted by the source code analysis unit in a relationship storage area;
A variable storage processing unit that stores information on the variable extracted by the source code analysis unit in a variable storage area;
A conversion rule storage unit that stores conversion rules for generating stereotype information to be given to a class based on information stored in the class storage area and the relation storage area;
Generate stereotype information according to the conversion rules stored in the conversion rule storage unit based on the information stored in the class storage area and the relation storage area, and correspond to the information about the class in the class storage area A stereotype information adding unit for storing information;
Information related to the class stored in the class storage area and provided with the stereotype information, information related to the relationship between the classes stored in the relation storage area, and information related to the variable stored in the variable storage area The program is made to function as a class diagram creation unit that creates a class diagram corresponding to the design information.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2005350053A JP2007156761A (en) | 2005-12-02 | 2005-12-02 | Design information generation device, program development system, design information generation method, program development method, and program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2005350053A JP2007156761A (en) | 2005-12-02 | 2005-12-02 | Design information generation device, program development system, design information generation method, program development method, and program |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2007156761A true JP2007156761A (en) | 2007-06-21 |
Family
ID=38241055
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2005350053A Withdrawn JP2007156761A (en) | 2005-12-02 | 2005-12-02 | Design information generation device, program development system, design information generation method, program development method, and program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2007156761A (en) |
-
2005
- 2005-12-02 JP JP2005350053A patent/JP2007156761A/en not_active Withdrawn
Similar Documents
Publication | Publication Date | Title |
---|---|---|
KR101307711B1 (en) | A consistent method system and computer program for developing software asset based solutions | |
EP1603034B1 (en) | Method and apparatus for generating user interfaces based upon automation with full flexibility | |
US8826225B2 (en) | Model transformation unit | |
TWI453666B (en) | Method and computer-readable storage medium for using collaborative development information in a team environment | |
JP5087261B2 (en) | Data element naming system and method | |
US8826227B2 (en) | Computer aided visualization of a business object model lifecycle | |
US9032002B2 (en) | Single file serialization for physical and logical meta-model information | |
JP2011060277A (en) | Integration environment generator | |
US20050273763A1 (en) | Method and apparatus for mapping a data model to a user interface model | |
CN103718155A (en) | Runtime system | |
US20120266131A1 (en) | Automatic program generation device, method, and computer program | |
CN104731588B (en) | Page layout document generating method and page layout file creating apparatus | |
US8949785B2 (en) | Custom compound types in declarative programs | |
Levendovszky et al. | A novel approach to semi-automated evolution of dsml model transformation | |
US20050015746A1 (en) | Orchestration designer | |
US9582291B2 (en) | Selecting a mapping that minimizes conversion costs | |
JPH10254689A (en) | Application constitution design supporting system for client/server system | |
US9244706B2 (en) | Command line shell command generation based on schema | |
JP4724387B2 (en) | Program conversion program, program conversion apparatus, and program conversion method | |
Cicchetti et al. | A Solution for Concurrent Versioning of Metamodels and Models. | |
US20100037202A1 (en) | Generation of graphical editors through meta model enrichment | |
Turkman et al. | Business process model driven automatic software requirements generation | |
JP2007156761A (en) | Design information generation device, program development system, design information generation method, program development method, and program | |
KR100846203B1 (en) | Method for generating mobile application and record media recorded program for realizing the same | |
Brown | MDA redux: Practical realization of model driven architecture |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A300 | Withdrawal of application because of no request for examination |
Free format text: JAPANESE INTERMEDIATE CODE: A300 Effective date: 20090203 |