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 PDF

Info

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
Application number
JP2005350053A
Other languages
Japanese (ja)
Inventor
Masahiro Sugaya
昌広 菅谷
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.)
Toshiba Corp
Toshiba Digital Solutions Corp
Original Assignee
Toshiba Corp
Toshiba Solutions 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 Toshiba Corp, Toshiba Solutions Corp filed Critical Toshiba Corp
Priority to JP2005350053A priority Critical patent/JP2007156761A/en
Publication of JP2007156761A publication Critical patent/JP2007156761A/en
Withdrawn legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To generate design information with stereotype information from a source code and reduce a transplant term of a source code with functional improvement between different platforms. <P>SOLUTION: A source code analysis section analyzes a source code, extracts information about a class, information about a relation between classes, and information about a variable, and stores them in a class storage processing section, a relation storage processing section and, a variable storage processing section. A stereotype information providing section generates information on stereotype according to a conversion rule based on information stored in the class storage processing section and the related storage processing section, associates them with the information about the class in the class storage processing section to store. A class figure creation section uses information about the class given information on stereotype, information about relations between classes, and information about a variable as design information of a program and creates a class figure corresponding to this design information. <P>COPYRIGHT: (C)2007,JPO&INPIT

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 Patent Document 1. However, when such a method is used, it is not possible to flexibly respond to customization requests such as function expansion and function addition that are likely to occur during porting. Therefore, at present, it is a mainstream to manually analyze the source code of the legacy system and extract design information, and then perform the porting work, which requires a long development period.

ところで、プログラムの開発手法としてMDA(Model Driven Architecture)が注目されている。MDAは、プラットフォーム(特定のプログラミング環境)に依存せず、UMLなどの標準モデリング技法を使ってアプリケーションの機能をモデル化し、さらにそのモデル情報を基にソースコードを自動生成する開発手法である。MDAでは、まず実装技術から独立する形でビジネスプロセスを分析し、プラットフォームに依存しないモデルであるPIM(Platform Independent Model)を作成する。続いてPIMをベースにモデルコンパイラと呼ばれるツールを用いて個別プラットフォームに特化したモデルであるPSM(Platform Specific Model)を生成する。さらにPIMもしくはPSMの情報から、ソースコード生成ツールを使って実際のソースコードに変換して実装作業を進めていく。
特開平5−88908号公報
By the way, MDA (Model Driven Architecture) attracts attention as a program development technique. MDA is a development method that does not depend on a platform (a specific programming environment), models an application function using a standard modeling technique such as UML, and further automatically generates source code based on the model information. In MDA, a business process is first analyzed in a manner independent of mounting technology, and a platform independent model (PIM) is created. Subsequently, a PSM (Platform Specific Model) that is a model specialized for an individual platform is generated using a tool called a model compiler based on the PIM. Furthermore, the PIM or PSM information is converted into actual source code using a source code generation tool, and the mounting work proceeds.
JP-A-5-88908

しかしながら、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 information generating apparatus 300.

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 / PSM conversion unit 12a corresponding to the second model compiler having the configuration of the present invention and a PSM / PIM conversion unit 12b corresponding to the first model compiler having the configuration of the present invention. The PIM / PSM conversion unit 12a, which is a second model compiler, has a function of converting the PIM 11 into the PSM 13. The PSM / PIM conversion unit 12b, which is the first model compiler, has a function of converting the PSMs 13 and 14 into the PIM 11. That is, the conversion from the PIM 11 to the PSM 13 in the MDA 200 is performed using the PIM / PSM conversion unit 12a of the model compiler 12.

設計情報生成装置300は、その主要部であるモデル抽出装置16と、モデル抽出装置16への入力である特定プラットフォームに特化したソースコード17と、変換ルール定義ファイル18と、モデル抽出装置16の成果物であるPSM14とで構成される。   The design information generation apparatus 300 includes a model extraction apparatus 16 that is a main part of the design information generation apparatus 300, a source code 17 specialized for a specific platform that is an input to the model extraction apparatus 16, a conversion rule definition file 18, and a model extraction apparatus 16. It consists of PSM14 which is a product.

モデル抽出装置16は、特定プラットフォームに特化したソースコード17から変換ルール定義ファイル18を用いて、プログラムの設計情報であるPSM14を生成する装置である。生成されたPSM14はモデルコンパイラ12のPSM/PIM変換部12bによってPIM11へと変換される。   The model extraction device 16 is a device that generates a PSM 14 that is program design information from a source code 17 specialized for a specific platform, using a conversion rule definition file 18. The generated PSM 14 is converted into the PIM 11 by the PSM / PIM conversion unit 12b of the model compiler 12.

図2はモデル抽出装置16の構成を説明するためのデータフローおよび機能ブロックである。   FIG. 2 is a data flow and functional blocks for explaining the configuration of the model extraction device 16.

モデル抽出装置16は、ソースコード解析部21、クラス記憶処理部22、関係記憶処理部23、変数記憶処理部24、ステレオタイプ情報付与部25、クラス図作成部26を情報処理部として備えている。また、モデル抽出装置16は、モデル抽出の処理に用いられる記憶領域として、クラス記憶領域27、関係記憶領域28、および変数記憶領域29をもつ。   The model extraction device 16 includes a source code analysis unit 21, a class storage processing unit 22, a relation storage processing unit 23, a variable storage processing unit 24, a stereotype information addition unit 25, and a class diagram creation unit 26 as information processing units. . The model extraction device 16 also has a class storage area 27, a relation storage area 28, and a variable storage area 29 as storage areas used for model extraction processing.

ソースコード解析部21は、ソースコード17を読み込んで解析し、クラス、クラス間の関係に関する情報、変数に関する情報を抽出して、クラス記憶処理部22、関係記憶処理部23、変数記憶処理部24にこれらの情報を出力する。クラス記憶処理部22は、クラス記憶領域27に対する書き込み、読み込み、検索を行う。関係記憶処理部23は、関係記憶領域28に対する書き込み、読み込み、検索を行う。変数記憶処理部24は、変数記憶領域29に対する書き込み、読み込み、検索を行う。   The source code analysis unit 21 reads and analyzes the source code 17, extracts information on classes, relationships between classes, and information on variables, and stores a class storage processing unit 22, a relationship storage processing unit 23, and a variable storage processing unit 24. To output this information. The class storage processing unit 22 performs writing, reading, and searching for the class storage area 27. The relation storage processing unit 23 writes, reads, and searches the relation storage area 28. The variable storage processing unit 24 performs writing, reading, and searching for the variable storage area 29.

ステレオタイプ情報付与部25は、クラス記憶領域27および関係記憶領域28に記憶された情報と変換ルール定義ファイル18の変換ルールとをもとに、クラス記憶領域27に記憶されたクラスの情報に付加するステレオタイプの情報を生成する。   The stereotype information adding unit 25 adds to the class information stored in the class storage area 27 based on the information stored in the class storage area 27 and the relation storage area 28 and the conversion rule of the conversion rule definition file 18. Generate stereotype information.

クラス図作成部26は、クラス記憶領域27、関係記憶領域28、および変数記憶領域29にそれぞれ記憶された情報をもとにPSMのクラス図を作成して、ユーザ31のためのディスプレイ30に表示する。   The class diagram creation unit 26 creates a PSM class diagram based on the information stored in the class storage area 27, the relationship storage area 28, and the variable storage area 29, and displays it on the display 30 for the user 31. To do.

次に、モデル抽出の処理に用いられる記憶領域である、クラス記憶領域27、関係記憶領域28、および変数記憶領域29に記憶される情報の構成を説明する。   Next, the configuration of information stored in the class storage area 27, the relation storage area 28, and the variable storage area 29, which are storage areas used for model extraction processing, will be described.

図3にクラス記憶領域27に記憶されるクラスに関する情報の構成を示す図である。同図に示すように、クラス記憶領域27に記憶されるクラスに関する情報は、クラスID、クラス名、ステレオタイプの項目からなる。ここで、クラスIDはソースコードに現れる全てのクラスを識別するための情報である。クラス名はクラスIDで識別される各々のクラスの名前(名称)である。ステレオタイプとは、UMLの機能の一つで、クラスの役割や用法上の違いなどをモデル要素に修飾するために用いられる情報である。クラスの役割や用法上の違いは同一のモデル要素でも発生し得ることから、ステレオタイプによってこのような違いを表記することができる。   FIG. 3 is a diagram showing a configuration of information related to classes stored in the class storage area 27. As shown in the figure, the information on the class stored in the class storage area 27 includes items of class ID, class name, and stereotype. Here, the class ID is information for identifying all classes appearing in the source code. The class name is the name (name) of each class identified by the class ID. A stereotype is one of the functions of UML, and is information used to modify the role of a class, a difference in usage, and the like into model elements. Differences in class roles and usage can occur in the same model element, so such differences can be represented by stereotypes.

図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 relationship storage area 28. As shown in the figure, the information related to the relationship between classes stored in the relationship storage area 28 includes a client class ID, a supplier class ID, and a relationship item. Here, the relationship is a relationship between two classes indicated by the client class ID and the supplier class ID. Types of relationships include 'relationship', 'aggregation', 'dependence', 'inheritance', and 'realization'. The client class is a class that sends a message, and the supplier class is a class that receives a message.

図5は変数記憶領域29に記憶される変数に関する情報の構成を示す図である。同図に示すように、変数記憶領域29に記憶される変数に関する情報は、フィールド変数が所属するクラスのクラスID、フィールド変数名、フィールド変数のクラスのクラスIDからなる。ここで変数とは、クラスのフィールド変数である。   FIG. 5 is a diagram showing a configuration of information regarding variables stored in the variable storage area 29. As shown in the figure, the information related to the variable stored in the variable storage area 29 includes the class ID of the class to which the field variable belongs, the field variable name, and the class ID of the field variable class. Here, the variable is a field variable of the class.

次に、変換ルール定義ファイル18の変換ルールについて説明する。   Next, the conversion rule of the conversion rule definition file 18 will be described.

図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 relationship storage area 28 and the relationship is “realization”, the stereo of << Controller >> is set as the class of the client ID Give type. The stereotype is recorded in the class storage area 27.

・ルール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 relationship storage area 28, and the relationship is 'inherit', the stereo of << View >> as the class of the client ID Give type. The stereotype is stored in the class storage area 27.

・ルール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 class storage area 27.

・ルール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 rules 1 to 4 and the stereotype is not attached, the stereotype << Model >> is assigned to the class to be processed. The stereotype is stored in the class storage area.

次に、本実施形態の設計情報生成装置300の動作を説明する。   Next, the operation of the design information generation apparatus 300 according to this embodiment will be described.

図7は本実施形態の設計情報生成装置300の全体的な動作を示すシーケンス図である。   FIG. 7 is a sequence diagram showing the overall operation of the design information generation apparatus 300 of this embodiment.

1:ユーザ31は、図示しない入力装置を用いて、ソースコード解析部21に対してソースコード17のモデル化を指示する。   1: The user 31 instructs the source code analysis unit 21 to model the source code 17 using an input device (not shown).

2:ソースコード解析部21は、この指示に従ってソースコード17を解析し、クラス、関係、変数に関する情報をそれぞれ抽出して、クラス記憶処理部22、関係記憶処理部23、変数記憶処理部24にわたす。クラス記憶処理部22、関係記憶処理部23、変数記憶処理部24はソースコード解析部21から受け取った情報を、クラス記憶領域27、関係記憶領域28、および変数記憶領域29に記憶する。なお、このときの動作については、図8を用いて後で詳細に説明する。   2: The source code analysis unit 21 analyzes the source code 17 in accordance with this instruction, extracts information on classes, relationships, and variables, and stores them in the class storage processing unit 22, the relationship storage processing unit 23, and the variable storage processing unit 24. I give it. The class storage processing unit 22, the relationship storage processing unit 23, and the variable storage processing unit 24 store the information received from the source code analysis unit 21 in the class storage area 27, the relationship storage area 28, and the variable storage area 29. The operation at this time will be described later in detail with reference to FIG.

3:ソースコード解析部21は、ステレオタイプ情報付与部25に対してステレオタイプの情報の付与を指示する。   3: The source code analysis unit 21 instructs the stereotype information giving unit 25 to give stereotype information.

4:ステレオタイプ情報付与部25は、この指示を受けると、クラス記憶領域27および関係記憶領域28に記憶された情報と変換ルール定義ファイル18の変換ルールとをもとに、クラス記憶領域27に記憶されたクラスに関する情報にそれぞれ付加するステレオタイプの情報を生成してこれらの付与を行う。なお、このときの動作については、図15を用いて後で詳細に説明する。   4: Upon receiving this instruction, the stereotype information adding unit 25 stores the information in the class storage area 27 based on the information stored in the class storage area 27 and the relation storage area 28 and the conversion rules of the conversion rule definition file 18. Stereotype information to be added to the information about the stored class is generated and given. The operation at this time will be described later in detail with reference to FIG.

5:ステレオタイプ情報付与部25は、クラス図作成部26に対してクラス図の作成を指示する。   5: The stereotype information giving unit 25 instructs the class diagram creating unit 26 to create a class diagram.

6:クラス図作成部26は、クラス記憶領域27、関係記憶領域28、および変数記憶領域29にそれぞれ記憶された情報をもとに、ステレオタイプの情報の付与されたPSMのクラス図を作成する。このクラス図作成部26の処理の詳細は後で説明する。   6: The class diagram creation unit 26 creates a PSM class diagram to which stereotype information is added based on the information stored in the class storage area 27, the relation storage area 28, and the variable storage area 29, respectively. . Details of the processing of the class diagram creation unit 26 will be described later.

7:クラス図作成部26は、作成したクラス図の表示をディスプレイ30に指示する。   7: The class diagram creation unit 26 instructs the display 30 to display the created class diagram.

8:ディスプレイ30は、クラス図作成部26より与えられたクラス図を表示する。   8: The display 30 displays the class diagram given by the class diagram creation unit 26.

次に、上記のソースコード解析の動作の詳細を説明する。   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 user 31 instructs the source code analysis unit 21 to model the source code 17 using an input device (not shown).

2:ソースコード解析部21は、このモデル化の指示に従ってソースコード17を読み込む。   2: The source code analysis unit 21 reads the source code 17 in accordance with the modeling instruction.

3:ソースコード解析部21は、読み込んだソースコード17のクラス宣言を読み込む。   3: The source code analysis unit 21 reads the class declaration of the read source code 17.

3.1:ソースコード解析部21は、ソースコード17からクラスXの名前(クラス名)を抽出するとともに、このクラスXに対してID(クラスID)を付与する。そしてソースコード解析部21は、そのクラスXのクラス名とクラスIDをクラス記憶処理部22を通じてクラス記憶領域27に記憶する。図9ないし図11のソースコードの例では、Counter、CounterListener、CounterViewなどのクラス名が抽出されてそれぞれにクラスIDが付与される。   3.1: The source code analysis unit 21 extracts the name of the class X (class name) from the source code 17 and assigns an ID (class ID) to the class X. Then, the source code analysis unit 21 stores the class name and class ID of the class X in the class storage area 27 through the class storage processing unit 22. In the source code examples of FIGS. 9 to 11, class names such as Counter, CounterListener, and CounterView are extracted, and class IDs are assigned to the class names.

3.2:ソースコード解析部21は、スーパークラスの解析を行う。   3.2: The source code analysis unit 21 performs superclass analysis.

3.2.1:ソースコード解析部21は、クラスXのスーパークラスYの名前(クラス名)を抽出するとともに、このスーパークラスYにID(クラスID)を付与する。そしてソースコード解析部21は、そのスーパークラスのクラス名とクラスIDをクラス記憶処理部22を通じてクラス記憶領域27に記憶する。たとえば、CounterViewのクラスのスーパークラスの名前としてJFrameが抽出され、これにクラスIDが付与される。   3.2.1: The source code analysis unit 21 extracts the name (class name) of the superclass Y of the class X and assigns an ID (class ID) to the superclass Y. The source code analysis unit 21 stores the class name and class ID of the super class in the class storage area 27 through the class storage processing unit 22. For example, JFrame is extracted as the superclass name of the CounterView class, and a class ID is assigned to it.

3.2.2:ソースコード解析部21は、クラスXとスーパークラスYの各クラスIDおよびそのクラス間の関係を関係記憶処理部23を通じて関係記憶領域28に記憶する。この場合のクラス間の関係は一意に継承となる。ここで、クラスXのクラスIDはクライアントクラスIDとして、スーパークラスYのクラスIDはサプライヤクラスIDとして関係記憶領域28に記憶される。   3.2.2: The source code analysis unit 21 stores the class IDs of the class X and the super class Y and the relationship between the classes in the relationship storage area 28 through the relationship storage processing unit 23. In this case, the relationship between classes is uniquely inherited. Here, the class ID of the class X is stored in the relationship storage area 28 as the client class ID, and the class ID of the super class Y is stored as the supplier class ID.

3.3:ソースコード解析部21は、インターフェースの解析を行う。   3.3: The source code analysis unit 21 performs interface analysis.

3.3.1:ソースコード解析部21は、クラスXのインターフェースZの名前(クラス名)を抽出するとともに、このインターフェースZにID(クラスID)を付与する。そしてソースコード解析部21は、そのインターフェースZのクラス名とクラスIDをクラス記憶処理部22を通じてクラス記憶領域27に記憶する。   3.3.1: The source code analysis unit 21 extracts the name (class name) of the interface Z of class X and assigns an ID (class ID) to the interface Z. The source code analysis unit 21 stores the class name and class ID of the interface Z in the class storage area 27 through the class storage processing unit 22.

3.3.2:ソースコード解析部21は、クラスXとインターフェースZの各クラスIDおよびそのクラス間の関係を関係記憶処理部23を通じて関係記憶領域28に記憶する。この場合の関係は一意に実現となる。ここで、クラスXのクラスIDはクライアントクラスIDとして、インターフェースZのクラスIDはサプライヤクラスIDとして関係記憶領域28に記憶される。   3.3.2: The source code analysis unit 21 stores the class IDs of the class X and the interface Z and the relationship between the classes in the relationship storage area 28 through the relationship storage processing unit 23. The relationship in this case is uniquely realized. Here, the class ID of the class X is stored in the relation storage area 28 as the client class ID, and the class ID of the interface Z is stored as the supplier class ID.

3.4:ソースコード解析部21は、クラス宣言のクラス本体の解析を行う。   3.4: The source code analysis unit 21 analyzes the class body of the class declaration.

3.4.1:ソースコード解析部21は、クラス宣言のクラス本体の解析結果からフィールド(図9ないし図11の符号3.4.1の各行)の解析を行う。   3.4.1: The source code analysis unit 21 analyzes a field (each line 3.4.1 in FIGS. 9 to 11) from the analysis result of the class body of the class declaration.

3.4.1.1:ソースコード解析部21は、フィールドの解析結果からフィールド変数のクラスWの名前(クラス名)を抽出するとともに、そのクラスWにID(クラスID)を付与する。そして、ソースコード解析部21は、そのフィールド変数のクラスWのクラス名とクラスIDをクラス記憶処理部22を通じてクラス記憶領域27に記憶する。   3.4.1.1: The source code analysis unit 21 extracts the name (class name) of the class W of the field variable from the analysis result of the field and assigns an ID (class ID) to the class W. Then, the source code analysis unit 21 stores the class name and class ID of the class W of the field variable in the class storage area 27 through the class storage processing unit 22.

3.4.1.2:ソースコード解析部21は、フィールド変数の変数名aとそのフィールド変数のクラスWのクラスID、所属クラスXのIDを、変数に関する情報として変数記憶処理部24を通じて変数記憶領域29に記憶する。   3.4.1.2: The source code analysis unit 21 sends the variable name a of the field variable, the class ID of the class W of the field variable, and the ID of the belonging class X to the variable storage area 29 through the variable storage processing unit 24 as information about the variable. Remember.

3.4.1.3:ソースコード解析部21は、所属クラスXとフィールド変数のクラスWの各クラスIDおよびそのクラス間の関係を関係記憶処理部23を通じて関係記憶領域28に記憶する。この場合の関係は一意に集約となる。   3.4.1.3: The source code analysis unit 21 stores the class IDs of the belonging class X and the field variable class W and the relationship between the classes in the relationship storage area 28 through the relationship storage processing unit 23. The relationship in this case is uniquely aggregated.

3.4.2:ソースコード解析部21は、メソッド宣言の解析を行う。   3.4.2: The source code analysis unit 21 analyzes the method declaration.

3.4.2.1:ソースコード解析部21は、結果型のクラスUの名前(クラス名)を抽出し
、このクラスUにID(クラスID)を付与する。そして、ソースコード解析部21は、その結果型のクラスUのクラス名とクラスIDを、クラス記憶処理部22を通じてクラス記憶領域27に記憶する。
3.4.2.1: The source code analysis unit 21 extracts the name (class name) of the result type class U and assigns an ID (class ID) to the class U. Then, the source code analysis unit 21 stores the class name and class ID of the result type class U in the class storage area 27 through the class storage processing unit 22.

3.4.2.2:ソースコード解析部21は、その結果型のクラスUと所属クラスXの各クラスIDおよびその関係を関係記憶処理部23を通じて関係記憶領域28に記憶する。この場合の関係は一意に依存となる。ここで、結果型のクラスUのクラスIDはクライアントクラスIDとして、所属クラスXのクラスIDはサプライヤクラスIDとして関係記憶領域28に記憶される。   3.4.2.2: The source code analysis unit 21 stores the class ID of the result type class U and the belonging class X and the relationship thereof in the relationship storage area 28 through the relationship storage processing unit 23. The relationship in this case is uniquely dependent. Here, the class ID of the result type class U is stored in the relationship storage area 28 as the client class ID, and the class ID of the belonging class X is stored as the supplier class ID.

3.4.3:ソースコード解析部21は、メソッド本体の解析を行う。   3.4.3: The source code analysis unit 21 analyzes the method body.

3.4.3.1:ソースコード解析部21は、メソッド本体の解析結果からブロックで利用されているローカル変数のクラスVの名前(クラス名)を抽出するとともに、このローカル変数のクラスVにID(クラスID)を付与する。そしてソースコード解析部21は、そのローカル変数のクラスVのクラス名とクラスIDをクラス記憶処理部22を通じてクラス記憶領域27に記憶する。   3.4.3.1: The source code analysis unit 21 extracts the name (class name) of the class V of the local variable used in the block from the analysis result of the method body, and also assigns an ID (class ID) to the class V of the local variable. ). Then, the source code analysis unit 21 stores the class name and class ID of the class V of the local variable in the class storage area 27 through the class storage processing unit 22.

3.4.3.2:ソースコード解析部21は、所属クラスXとローカル変数のクラスVの各IDおよびそのクラス間の関係を関係記憶処理部23を通じて関係記憶領域28に記憶する。この場合の関係は一意に依存となる。ここで、ローカル変数のクラスVのクラスIDはクライアントクラスIDとして、所属クラスXのクラスIDはサプライヤクラスIDとして関係記憶領域28に記憶される。   3.4.3.2: The source code analysis unit 21 stores the IDs of the belonging class X and the local variable class V and the relationship between the classes in the relationship storage area 28 through the relationship storage processing unit 23. The relationship in this case is uniquely dependent. Here, the class ID of the local variable class V is stored in the relation storage area 28 as the client class ID and the class ID of the belonging class X is stored as the supplier class ID.

以上により、クラス記憶領域27、関係記憶領域28、および変数記憶領域29に、ソースコード17の解析によって得られた情報がそれぞれ記憶される。   As described above, the information obtained by analyzing the source code 17 is stored in the class storage area 27, the relation storage area 28, and the variable storage area 29, respectively.

図12は図9ないし図11のソースコードを含むソースコード17から上記の解析によってクラス記憶領域27に記憶されたクラスに関する情報の例である。このように、ソースコード17に記述されている全てのクラスのクラスIDおよびクラス名がクラス記憶領域27に記憶される。ステレオタイプ情報の項目は全て空欄である。   FIG. 12 is an example of information on classes stored in the class storage area 27 from the source code 17 including the source codes of FIGS. 9 to 11 by the above analysis. In this way, the class IDs and class names of all classes described in the source code 17 are stored in the class storage area 27. All items of stereotype information are blank.

図13は同じくそのソースコード17から上記の解析によって関係記憶領域28に記憶されたクラス間の関係に関する情報の例を示す。このように、ソースコード17に記述されている全てのクラス間の関係(関連、集約、依存、継承、実現など)が関係記憶領域28に記憶される。   FIG. 13 also shows an example of information related to the relationship between classes stored in the relationship storage area 28 from the source code 17 by the above analysis. In this way, the relationships (relationship, aggregation, dependence, inheritance, realization, etc.) between all classes described in the source code 17 are stored in the relationship storage area 28.

図14は同じくそのソースコード17から上記の解析によって変数記憶領域29に記憶されたフィールド変数に関する情報の例を示す。このように、ソースコード17に記述されている全てのフィールド変数などが関係記憶領域28に記憶される。   FIG. 14 also shows an example of information relating to field variables stored in the variable storage area 29 by the above analysis from the source code 17. In this way, all field variables and the like described in the source code 17 are stored in the relation storage area 28.

次に、ステレオタイプ情報の付与に関する動作の詳細を説明する。   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 information adding unit 25 receives an instruction to add stereotype information from the source code analyzing unit 21.

1.1:ステレオタイプ情報付与部25は、このステレオタイプの情報の付与の指示を受け取ると、変換ルール定義ファイル18を読み込む。   1.1: Upon receiving this stereotype information addition instruction, the stereotype information addition unit 25 reads the conversion rule definition file 18.

1.2:ステレオタイプ情報付与部25は、読み込んだ変換ルール定義ファイル18に記述された変換ルール(図6)に従って、クラス記憶領域27(図12)に記憶された全てのクラスに対して付与するステレオタイプ情報を判定するための処理を開始する。   1.2: Stereotype information assigning unit 25 assigns stereo to all classes stored in class storage area 27 (FIG. 12) in accordance with the conversion rules (FIG. 6) described in conversion rule definition file 18 that has been read. Processing for determining type information is started.

1.2.1:まず、ステレオタイプ情報付与部25は、クラス記憶領域27に記憶されている全てのクラスのクラスIDとクラス名との対応関係を読み込む。   1.2.1: First, the stereotype information giving unit 25 reads the correspondence relationship between the class IDs and class names of all classes stored in the class storage area 27.

1.2.2:ステレオタイプ情報付与部25は、関係記憶領域28(図13)に記憶されている全ての、関係するクラスの組み合わせであるクライアントクラスIDとサプライヤクラスIDとの組み合わせ、およびこれらのクラス間の関係を読み込む。   1.2.2: Stereotype information giving unit 25 is a combination of client class ID and supplier class ID, which is a combination of all related classes stored in relation storage area 28 (FIG. 13), and these classes. Read the relationship between.

1.2.3:ステレオタイプ情報付与部25は、以上読み込んだ変換ルール、クラスIDとクラス名との対応関係、関係するクラスの組み合わせおよびその関係をもとに、ステレオタイプ情報を付与する対象のクラスとその付与すべきステレオタイプ情報を決定する。   1.2.3: The stereotype information giving unit 25 reads the conversion rule, the correspondence between the class ID and the class name, the combination of the related classes and the class to which the stereotype information is given based on the relation. And stereotype information to be given.

1.2.3.1:ステレオタイプ情報付与部25は、決定したステレオタイプ情報を該当するクラスと対応付けてクラス記憶領域27に記憶する。   1.2.3.1: The stereotype information adding unit 25 stores the determined stereotype information in the class storage area 27 in association with the corresponding class.

1.3:ステレオタイプ情報付与部25は、必要なクラスに対するステレオタイプ情報の付与が全て完了したところで、クラス図作成部26に対してクラス図の作成を指示する。   1.3: The stereotype information giving unit 25 instructs the class diagram creating unit 26 to create a class diagram when all the stereotype information has been given to the necessary classes.

図16はクラス記憶領域27にステレオタイプ情報が付与された結果を示す図である。ここで、同図に示すステレオタイプ情報が具体的にどのように決定されたのかを説明する。   FIG. 16 is a diagram showing a result of adding stereotype information to the class storage area 27. Here, how the stereotype information shown in the figure is specifically determined will be described.

クラス記憶領域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 class storage area 27 is based on rule 2 in the conversion rules shown in FIG. The information stored in the relationship storage area 28 that matches the rule 2 condition is the information on the first line. Based on the action of the rule 2, the class of CounterView class 0 is << The View >> stereotype is assigned.

クラス記憶領域27の3行目のクラスに付与されたステレオタイプ<<Model>>は、図6に示した変換ルールの中のルール5に基づくものである。   The stereotype << Model >> assigned to the class in the third row of the class storage area 27 is based on the rule 5 in the conversion rules shown in FIG.

クラス記憶領域27の9行目のクラスに付与されたステレオタイプ<<Controller>>は、図6に示した変換ルールの中のルール1に基づくものである。   The stereotype << Controller >> assigned to the class in the ninth line of the class storage area 27 is based on the rule 1 in the conversion rules shown in FIG.

クラス記憶領域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 class storage area 27 is based on the rule 3 in the conversion rule shown in FIG. The information stored in the relation storage area 28 that matches the rule 3 condition is the information on the 9th line. Based on the action of the rule 3, the class of ActionListener with class ID 9 is << interface>. Stereotype information of> is added.

また、クラス記憶領域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 class storage area 27. This is a result based on rule 4 in the conversion rules shown in FIG.

次に、クラス図作成部26によるクラス図の作成・表示処理について説明する。   Next, class diagram creation / display processing by the class diagram creation unit 26 will be described.

図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 information adding unit 25 to the class diagram creating unit 26.

1.1:クラス図作成部26は、ステレオタイプ情報付与部25よりクラス図の作成の指示を受けると、クラス記憶領域27から各クラスIDごとのクラス名とステレオタイプ情報を読み込む。   1.1: Upon receiving an instruction to create a class diagram from the stereotype information adding unit 25, the class diagram creating unit 26 reads the class name and stereotype information for each class ID from the class storage area 27.

1.2:クラス図作成部26は、変数記憶領域29からクラスIDごとのフィールド変数名を読み込む。   1.2: The class diagram creation unit 26 reads the field variable name for each class ID from the variable storage area 29.

1.3:クラス図作成部26は、ここまで読み込んだクラス名、ステレオタイプ情報、フィールド変数名から、クラス間の関係線を除くクラス図を作成する。   1.3: The class diagram creating unit 26 creates a class diagram excluding the relationship line between classes from the class name, stereotype information, and field variable name read up to here.

1.3.1:クラス図作成部26は、作成されたクラス間の関係線を除くクラス図の表示をディスプレイ30に指示する。   1.3.1: The class diagram creation unit 26 instructs the display 30 to display a class diagram excluding the created relationship lines between classes.

2:続いてクラス図作成部26は、関係記憶領域28から関係するクラスIDの組み合わせ(クライアントクラスIDとサプライヤクラスID)とその関係を読み込む。   2: Subsequently, the class diagram creating unit 26 reads the related class ID combination (client class ID and supplier class ID) and the relationship from the relationship storage area 28.

3:クラス図作成部26は、関係記憶領域28から読み込んだクラスID(クライアントクラスIDとサプライヤクラスID)に対応するクラス名をクラス記憶領域27から読み込む。   3: The class diagram creation unit 26 reads the class name corresponding to the class ID (client class ID and supplier class ID) read from the relation storage area 28 from the class storage area 27.

4:クラス図作成部26は、2:と3:で読み込んだ情報をもとにクラス間の関係線を作成する。   4: The class diagram creation unit 26 creates a relationship line between classes based on the information read in 2: and 3 :.

4.1:クラス図作成部26は、作成したクラス間の関係線の表示をディスプレイ30に指示する。   4.1: The class diagram creation unit 26 instructs the display 30 to display the created relationship lines between classes.

図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, reference numeral 33 is the upper stage, 34 is the middle stage, and 35 is the lower stage. In the upper part, the class name and stereotype are described, and the stereotype is described above the class name. Field variables (attributes) are described in the middle (not shown in the figure). The lower part describes the method (operation) (omitted in the figure). The relationship line between classes represents the type of relationship by the line type and the shape of the end.

図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 class storage area 27, and FIG. 20 shows the correspondence between the relation line in the class diagram of FIG. 18 and the information in the relation storage area 28. .

以上説明したように、本実施形態の設計情報生成装置300によれば、特定プラットフォームに特化したソースコード17から、クラスにステレオタイプの情報が付与された設計情報を生成することができる。また、生成された設計情報からクラス図を作成して、設計者に掲示することができる。さらに、本実施形態のプログラム開発システム100によれば、異なるプラットフォーム間でのソースコードの移植を行う際に、プラットフォームに依存しない設計情報のレベルで必要なカスタマイズを行うことができるので、異なるプラットフォーム間でのソースコードの移植工期の短縮を図ることができる。   As described above, according to the design information generation apparatus 300 of this embodiment, design information in which stereotype information is assigned to a class can be generated from the source code 17 specialized for a specific platform. In addition, a class diagram can be created from the generated design information and posted to the designer. Furthermore, according to the program development system 100 of the present embodiment, when source code is ported between different platforms, necessary customization can be performed at the level of design information that does not depend on the platform. Can shorten the source code porting period.

次に、本発明の第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 model correction unit 41 to the model extraction device 16 of the first embodiment shown in FIG.

このモデル補正部41は、クラス図作成部26によってディスプレイ30に表示されたクラス図を参照したユーザ31から入力部を通じて入力された修正命令を受けて、その修正内容をクラス記憶処理部22、関係記憶処理部23、変数記憶処理部24を通じてクラス記憶領域27、関係記憶領域28、変数記憶領域29の情報に反映させるための手段である。クラス記憶領域27、関係記憶領域28、変数記憶領域29のそれぞれ修正内容は、クラス図作成部26によって、ディスプレイ30に表示されたクラス図に反映される。   The model correction unit 41 receives a correction command input through the input unit from the user 31 referring to the class diagram displayed on the display 30 by the class diagram creation unit 26, and sends the correction contents to the class storage processing unit 22 and the relationship. This is means for reflecting the information in the class storage area 27, the relation storage area 28, and the variable storage area 29 through the storage processing section 23 and the variable storage processing section 24. The correction contents of the class storage area 27, the relation storage area 28, and the variable storage area 29 are reflected on the class diagram displayed on the display 30 by the class diagram creation unit 26.

図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 user 31 The result of giving information is shown.

なお、本発明は、上述の実施形態にのみ限定されるものではなく、本発明の要旨を逸脱しない範囲内において種々更新を加え得ることは勿論である。   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.

本発明の一実施形態にかかる設計情報生成装置を採用したプログラム開発システムの構成を示す図。The figure which shows the structure of the program development system which employ | adopted the design information generation apparatus concerning one Embodiment of this invention. 図1の設計情報生成装置の主要部であるモデル抽出装置の構成を説明するためのデータフローおよび機能ブロック図。The data flow and functional block diagram for demonstrating the structure of the model extraction apparatus which is the principal part of the design information generation apparatus of FIG. クラス記憶領域に記憶されるクラスに関する情報の構成を示す図。The figure which shows the structure of the information regarding the class memorize | stored in a class storage area. 関係記憶領域に記憶されるクラス間の関係に関する情報の構成を示す図。The figure which shows the structure of the information regarding the relationship between the classes memorize | stored in a relationship storage area. 変数記憶領域に記憶される変数に関する情報の構成を示す図。The figure which shows the structure of the information regarding the variable memorize | stored in a variable memory area. 変換ルール定義ファイルの内容を示す図表。A chart showing the contents of a conversion rule definition file. 図2の設計情報生成装置の全体的な動作を示すシーケンス図。FIG. 3 is a sequence diagram illustrating an overall operation of the design information generation apparatus in FIG. 2. 図7中のソースコード解析の動作に関するシーケンス図。FIG. 8 is a sequence diagram relating to the operation of source code analysis in FIG. 7. ソースコードの例を示す図。The figure which shows the example of a source code. ソースコードの例を示す図。The figure which shows the example of a source code. ソースコードの例を示す図。The figure which shows the example of a source code. クラス記憶領域に記憶されたクラスに関する情報の具体例を示す図。The figure which shows the specific example of the information regarding the class memorize | stored in the class storage area. 関係記憶領域に記憶されたクラス間の関係に関する情報の具体例を示す図。The figure which shows the specific example of the information regarding the relationship between the classes memorize | stored in the relationship memory area. 変数記憶領域に記憶されたフィールド変数に関する情報の具体例を示す図。The figure which shows the specific example of the information regarding the field variable memorize | stored in the variable memory area. ステレオタイプ情報の付与の動作に関するシーケンス図。The sequence diagram regarding the operation | movement of provision of stereotype information. クラス記憶領域にステレオタイプ情報が付与された結果を示す図。The figure which shows the result as which the stereotype information was provided to the class storage area. クラス図の作成・表示処理に関するシーケンス図。The sequence diagram regarding creation / display processing of a class diagram. 作成されたクラス図の例を示す図。The figure which shows the example of the created class diagram. 図18のクラスとクラス記憶領域の情報との対応関係を示す図。The figure which shows the correspondence of the class of FIG. 18, and the information of a class storage area. 図18のクラス図における関係線と関係記憶領域の情報との対応関係を示す図。The figure which shows the correspondence of the relationship line in the class diagram of FIG. 18, and the information of a relationship storage area. 第2の実施形態である設計情報生成装置におけるモデル抽出装置の構成を説明するためのデータフローおよび機能ブロック図。The data flow and functional block diagram for demonstrating the structure of the model extraction apparatus in the design information generation apparatus which is 2nd Embodiment. 図18のクラス図の補正例を示す図。The figure which shows the correction example of the class diagram of FIG.

符号の説明Explanation of symbols

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. Area 41... Model correction unit 100 100 program development system 116 model extraction device 300 design information generation device

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に記載の設計情報生成装置。   The apparatus further comprises a model correction unit for correcting stereotype information stored in the class storage area based on an input from a designer referring to the class diagram created by the class diagram creation unit. The design information generating apparatus according to claim 1. 請求項1の設計情報生成装置と、
この設計情報生成装置にて生成された前記プログラムの設計情報を、プラットフォームに依存しない設計情報に変換する第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.
モデル補正部にて、前記クラス図作成部により作成された前記クラス図を参照した設計者からの入力をもとに、前記クラス記憶領域に記憶されたステレオタイプの情報を補正するステップをさらに具備することを特徴とする請求項4に記載の設計情報生成方法。   The model correction unit further includes a step of correcting 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. The design information generation method according to claim 4, wherein: 請求項4の設計情報生成方法にて生成された前記プログラムの設計情報を、第1のモデルコンパイラにてプラットフォームに依存しない設計情報に変換するステップと、
前記第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.
前記コンピュータを、前記クラス図作成部により作成された前記クラス図を参照した設計者からの入力をもとに、前記クラス記憶領域に記憶されたステレオタイプの情報を補正するモデル補正部としても機能させることを特徴とする請求項7に記載のプログラム。   The computer also functions as a model correction unit that 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. The program according to claim 7, wherein:
JP2005350053A 2005-12-02 2005-12-02 Design information generation device, program development system, design information generation method, program development method, and program Withdrawn JP2007156761A (en)

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)

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