JP5952716B2 - Class diagram conversion device and class diagram conversion program - Google Patents
Class diagram conversion device and class diagram conversion program Download PDFInfo
- Publication number
- JP5952716B2 JP5952716B2 JP2012242918A JP2012242918A JP5952716B2 JP 5952716 B2 JP5952716 B2 JP 5952716B2 JP 2012242918 A JP2012242918 A JP 2012242918A JP 2012242918 A JP2012242918 A JP 2012242918A JP 5952716 B2 JP5952716 B2 JP 5952716B2
- Authority
- JP
- Japan
- Prior art keywords
- pattern
- class
- conversion
- class diagram
- information
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
Images
Description
本発明は、オブジェクト指向のソフトウェア開発のため作成されたクラス図を、適切な他のクラス図に変換する、クラス図変換装置およびクラス図変換プログラムの技術に関する。 The present invention relates to a class diagram conversion device and a class diagram conversion program for converting a class diagram created for object-oriented software development into another appropriate class diagram.
近年のソフトウェア開発ではオブジェクト指向の開発手法が広く採用されており、特にJava(登録商標)を用いた開発では、UML(Unified Modeling Language)(登録商標)によるクラス図を利用することが多い。現在のオブジェクト指向開発の特徴として、UMLというモデリング言語を、概念モデリング工程から論理モデリング工程、実装する言語がJava言語等のオブジェクト指向言語であれば物理モデリング工程まで、一貫して使い続けて開発できることによって、上流工程から下流工程までを通しての仕様書自体の流用性が向上し仕様書作成作業の時間を削減できる。また、上流工程での設計の意図を同じモデリング言語を使うことで下流工程に伝えやすくなること等が知られている。 In recent software development, an object-oriented development method has been widely adopted. In particular, in development using Java (registered trademark), a class diagram based on UML (Unified Modeling Language) (registered trademark) is often used. As a feature of current object-oriented development, it is possible to develop UML modeling language consistently from concept modeling process to logical modeling process, and to the physical modeling process if the implementation language is an object-oriented language such as Java language. As a result, the applicability of the specification itself from the upstream process to the downstream process is improved, and the time for creating the specification can be reduced. In addition, it is known that the design intention in the upstream process can be easily communicated to the downstream process by using the same modeling language.
従来のモデリングと同様、オブジェクト指向に基づくソフトウェア開発においても、モデル化対象に対する構造の捉え方は一般に複数あり得るため、採用する構造の最終的な判断は、設計者が行う必要がある。これに関し、構造化手法等の従来の開発手法とは異なり、オブジェクト指向の開発手法においては、モデル化対象に対する構造(クラスおよびクラス間の関連)の捉え方として、クラスの組合せをパターン化した「デザインパターン」(なお、デザインパターンを複数まとめて提示(カタログ化)したものを、以下「デザインパターンカタログ」という。非特許文献1参照)や、クラスを再設計する方法をカタログ化した「リファクタリングカタログ」が提案されている(非特許文献2参照)。これにより、モデル化対象の構造を従来に比べ決定しやすくなっている。 Similar to conventional modeling, in object-oriented software development, there can generally be multiple ways of grasping the structure for the modeled object, so the final decision on the structure to be adopted must be made by the designer. In this regard, unlike conventional development methods such as structuring methods, object-oriented development methods pattern combinations of classes as a way of understanding the structure (class and relationship between classes) for the modeled object. "Design patterns" (Note that what is presented (catalogized) together with multiple design patterns is referred to as "Design Pattern Catalog". Refer to Non-Patent Document 1) and "Refactoring Catalog" that catalogs methods for redesigning classes. Is proposed (see Non-Patent Document 2). This makes it easier to determine the structure to be modeled than in the past.
しかしながら、オブジェクト指向に基づくソフトウェア開発において、実際に設計者がデザインパターンやリファクタリングカタログを使用したい場合に、現状では、以下に示す問題がある。
・そもそも、デザインパターンやリファクタリングカタログをサポートするツールが充分ではない。
・さらに、既存のデザインパターンやリファクタリングカタログを利用するためには、個々のデザインパターンやリファクタリングに対する高度な知識が必要となるため、利用しにくい。
However, in the software development based on object orientation, when a designer actually wants to use a design pattern or a refactoring catalog, there are the following problems at present.
・ In the first place, there are not enough tools to support design patterns and refactoring catalogs.
・ Furthermore, in order to use existing design patterns and refactoring catalogs, it is difficult to use because it requires advanced knowledge of individual design patterns and refactoring.
また、構造化設計のときと同様に、オブジェクト指向に基づくソフトウェア開発においては、下流工程においてモデリング性能等の実装を考慮した構造設計を行う一方で、上流工程のモデリングでは実装方式や実装する言語、ミドルウェア等に依らない抽象的な構造設計を行うため、クラス図で表現される構造が一般に異なってくる。しかし、このように各工程での観点の違いを考慮したクラス図の変換ツールは存在しない。 As in the case of structured design, in object-oriented software development, structural design that takes into account the implementation of modeling performance etc. is performed in the downstream process, while in the upstream process modeling, the implementation method, language to be implemented, In order to design an abstract structure that does not depend on middleware or the like, the structure represented by the class diagram generally differs. However, there is no class diagram conversion tool that takes into account the difference in viewpoint in each process.
さらに、実際にクラス設計を行う場合に、モデルの表現方法が複数存在するため、どのデザインパターン(構造)で表現するのが最適かを設計者が迷うことが多い。その場合、設計者は、複数のデザインパターンそれぞれに当てはめ直してクラス図におけるクラスをひとつひとつ手作業で変更して最適なデザインパターンで表現するように試行錯誤する必要があり、非常に大きな労力を有する。 Furthermore, when class design is actually performed, there are a plurality of model representation methods, and therefore, the designer often gets confused about which design pattern (structure) is best represented. In that case, the designer needs to reapply to each of the multiple design patterns and manually change each class in the class diagram to express it with the optimal design pattern, which is very labor intensive. .
このような背景に鑑みて本発明がなされたのであり、本発明は、一旦作成されたクラス図を見直す際に、最適なデザインパターンによるクラス図の設計を支援する、クラス図変換装置およびクラス図変換プログラムを提供することを課題とする。 The present invention has been made in view of such a background, and the present invention provides a class diagram conversion device and a class diagram that support design of a class diagram based on an optimal design pattern when reviewing a class diagram once created. It is an object to provide a conversion program.
前記した課題を解決するため、請求項1に記載の発明は、オブジェクト指向のソフトウェア開発で利用されるクラス図における、クラスや前記クラス間の接続関係を表す関連の組合せで示される構造のパターンを、現時点のパターンと異なる他のパターンに変換して表示装置に表示させるクラス図変換装置であって、前記クラス図を構成する、前記クラス、前記クラスの属性および前記クラスの実例を示すオブジェクトを、前記クラス図を変換する際の対等な構成要素とし、前記クラス図内の2つの構成要素毎に、前記構成要素間の関連の種別と、前記クラス、前記属性、前記オブジェクトのいずれかを示す前記構成要素の種別とを用いて、変換前の前記クラス図の構成のパターンを示すクラス図情報、前記クラス図を構成するパターンが、所定のパターン群のうちのどのパターンに該当するかを前記クラス図情報を参照して特定するためのパターン判定ロジック、および、変換前のパターンと当該変換前のパターンにおいて変換可能な変換後のパターンとの組合せを示す変換パターンが複数格納される変換パターン情報を記憶する記憶手段と、前記変換前のクラス図情報を取得して前記変換前のクラス図を前記表示装置に表示させ、前記変換前のクラス図の前記クラス、前記属性および前記オブジェクトのうち少なくともいずれか1つが選択された変換対象となる適用箇所を、入力手段を介して取得し、取得した前記適用箇所に示される前記変換前のクラス図のパターンを、前記クラス図情報を参照して前記パターン判定ロジックに基づき特定し、前記特定したパターンについて変換可能な前記変換パターンを、前記変換パターン情報を参照して決定し、決定した前記変換可能な変換パターンに示される、前記変換前のパターンと当該変換前のパターンにおいて変換可能な1つ以上の変換後のパターンとを前記表示装置に表示させ、前記1つ以上の変換後のパターンのうちから選択された変換後のパターンの選択情報を、前記入力手段を介して取得し、前記適用箇所に示される前記変換前のクラス図のパターンを、取得した前記変換後のパターンに変換し、前記表示装置に表示させる表示処理手段と、を備えることを特徴とするクラス図変換装置とした。
In order to solve the above-described problem, the invention according to
このようにすることで、クラス図変換装置は、設計者等により選択されたクラス図変換の適用箇所のパターンを、パターン判定ロジックに基づき特定し、その特定したパターンについて変換可能な1つ以上の変換後のパターンを表示装置に表示させる。そして、クラス図変換装置は、適用箇所の選択情報に示される変換前のクラス図を、設計者等により選択された変換後のパターンに変換し、表示装置に表示することができる。
よって、設計者等は、表示装置に表示された1つ以上の変換後のパターンの中から、最適な変換後のパターンを選択することができるため、各パターン(デザインパターン)についての高度な知識を必要とすることがなく、クラス図を変換することが可能となる。
By doing in this way, the class diagram conversion device identifies the pattern of the application location of the class diagram conversion selected by the designer or the like based on the pattern determination logic, and can convert one or more that can be converted for the identified pattern The converted pattern is displayed on the display device. Then, the class diagram conversion device can convert the class diagram before conversion indicated in the selection information of the application location into a pattern after conversion selected by the designer or the like and display it on the display device.
Therefore, since the designers can select an optimal pattern after conversion from one or more converted patterns displayed on the display device, advanced knowledge about each pattern (design pattern). Class diagram can be converted without the need for.
請求項2に記載の発明は、前記所定のパターン群には、前記クラス図における、クラスと属性の関係を示すパターン、クラスの集約関係を示すパターン、クラスの集約関係において間に抽象クラスを有するパターン、クラスの集約関係において当該クラスがオブジェクトを備えるパターン、委譲により継承関係を実現するパターン、継承関係を示すパターン、を含むことを特徴とする請求項1に記載のクラス図変換装置とした。
According to a second aspect of the present invention, the predetermined pattern group includes a pattern indicating a relationship between a class and an attribute, a pattern indicating a class aggregation relationship, and an abstract class in the class aggregation relationship in the class diagram. The class diagram conversion device according to
このようにすることで、オブジェクト指向に基づくソフトウェア開発において、クラス図の設計時に、頻繁に利用され、かつ、複数のパターンで表現できるためどのパターンで表現するのが最適かを判断するのが難しい、クラスと属性の関係を示すパターン、クラスの集約関係を示すパターン、クラスの集約関係において間に抽象クラスを有するパターン、クラスの集約関係において当該クラスがオブジェクトを備えるパターン、委譲により継承関係を実現するパターン、継承関係を示すパターンについて、変換後のパターンを表示し、設計者等に選択させることができる。
請求項3に記載の発明は、前記変換パターン情報に格納される変換パターンとして、前記クラスと属性の関係を示すパターンを、前記クラスの集約関係を示すパターンに変換する変換パターンを含むことを特徴とする請求項2に記載のクラス図変換装置とした。
請求項4に記載の発明は、前記変換パターン情報に格納される変換パターンとして、前記クラスの集約関係を示すパターンを、前記クラスと属性の関係を示すパターン、前記クラスの集約関係において間に抽象クラスを有するパターン、前記クラスの集約関係において当該クラスがオブジェクトを備えるパターン、のそれぞれに変換する変換パターンを含むことを特徴とする請求項2に記載のクラス図変換装置とした。
請求項5に記載の発明は、前記変換パターン情報に格納される変換パターンとして、前記クラスの集約関係において間に抽象クラスを有するパターンを、前記クラスの集約関係を示すパターン、前記クラスの集約関係において当該クラスがオブジェクトを備えるパターン、のそれぞれに変換する変換パターンを含むことを特徴とする請求項2に記載のクラス図変換装置とした。
請求項6に記載の発明は、前記変換パターン情報に格納される変換パターンとして、前記クラスの集約関係において当該クラスがオブジェクトを備えるパターンを、前記クラスの集約関係を示すパターン、前記クラスの集約関係において間に抽象クラスを有するパターン、のそれぞれに変換する変換パターンを含むことを特徴とする請求項2に記載のクラス図変換装置とした。
請求項7に記載の発明は、前記変換パターン情報に格納される変換パターンとして、前記委譲により継承関係を実現するパターンと、前記継承関係を示すパターンとを相互に変換する変換パターンを含むことを特徴とする請求項2に記載のクラス図変換装置とした。
In this way, in software development based on object-oriented, when the design class diagram is frequently used, and it is difficult to determine optimal whether the at expressing any pattern for which can be expressed by a plurality of patterns , A pattern indicating the relationship between a class and an attribute, a pattern indicating a class aggregation relationship, a pattern having an abstract class in the class aggregation relationship, a pattern in which the class has objects in the class aggregation relationship, and an inheritance relationship realized by delegation The pattern after conversion and the pattern indicating the inheritance relationship can be displayed and selected by a designer or the like.
The invention according to
According to a fourth aspect of the present invention, as a conversion pattern stored in the conversion pattern information, a pattern indicating an aggregation relationship of the class is abstracted between a pattern indicating a relationship between the class and an attribute, and the aggregation relationship of the class. 3. The class diagram conversion device according to
In the invention according to
In the invention according to claim 6, as a conversion pattern stored in the conversion pattern information, a pattern in which the class includes an object in the aggregation relation of the class, a pattern indicating the aggregation relation of the class, and an aggregation relation of the class The class diagram conversion device according to
The invention according to claim 7 includes, as the conversion pattern stored in the conversion pattern information, a conversion pattern that mutually converts a pattern that realizes an inheritance relationship by the delegation and a pattern that indicates the inheritance relationship. The class diagram conversion device according to
請求項8に記載の発明は、コンピュータを、請求項1乃至請求項7のいずれか1項に記載のクラス図変換装置を構成する各手段として機能させるためのクラス図変換プログラムとした。
The invention according to claim 8, computer, and a class diagram conversion program to function as the respective means constituting the class diagram conversion device according to any one of
このようにすることで、コンピュータを、請求項1乃至請求項7のいずれか1項に記載のクラス図変換装置を構成する各手段として機能させることができる。
By doing in this way, a computer can be functioned as each means which comprises the class diagram conversion apparatus of any one of
本発明によれば、一旦作成されたクラス図を見直す際に、最適なデザインパターンによるクラス図の設計を支援する、クラス図変換装置およびクラス図変換プログラムを提供することができる。 According to the present invention, it is possible to provide a class diagram conversion device and a class diagram conversion program that support design of a class diagram with an optimal design pattern when reviewing a class diagram once created.
次に、本発明を実施するための形態(以下、「本実施形態」という)について、適宜図面を参照しながら詳細に説明する。 Next, a mode for carrying out the present invention (hereinafter referred to as “the present embodiment”) will be described in detail with reference to the drawings as appropriate.
<前提となる技術>
まず、本発明の前提となる技術について説明する。
<Prerequisite technology>
First, a technique that is a premise of the present invention will be described.
(デザインパターンの適用)
オブジェクト指向に基づくソフトウェア開発におけるデザインパターンの適用作業は、概ね以下の5段階から構成されている。
(Application of design pattern)
The application of design patterns in software development based on object orientation is generally composed of the following five stages.
(1)状況理解段階
設計者がモデル化対象を理解する段階であり、この段階で設計者はモデリングツール等を用いてモデルを可視化し、モデル化対象の理解を深める。
(2)デザインパターン選択段階
設計者は、デザインパターンカタログからUMLで書かれたデザインパターンを選択する。
(3)モデル/コード上での適用箇所決定段階
設計者は、選択したデザインパターンについて適用可能な箇所を設計モデル/実装コードで決定する。なお、現状では、ツールにより自動的に適用箇所を明示するような機能は開発されていないため、設計者がモデリングツールを用いて人手で決定する。
(4)展開段階
前記(3)の適用箇所決定段階で決定した箇所の構成要素(クラスや属性等)とデザインパターンを構成するロール(具体的なクラスの代わりに、その役割や振る舞いを抽象化したモデルとなる要素)とを対応付けて、その対応付けられた構成要素をデザインパターンに合うように変換・配置する。なお、現状では、設計者が構成要素を対応付けた後に、自動的に変換・配置する機能を有するモデリングツールが存在している(非特許文献1参照)。
(5)周囲調整段階
前記(4)の展開段階によりデザインパターンを展開した箇所の周辺を、展開前と比較して不具合がないか確認する。最終的な不具合の有無の判断は、現状では、設計者が行う必要がある。よって、(4)の展開段階で、構成要素を自動的に変換・配置した場合においても、設計者が不具合の有無を判断し、手動で修正を行う。
(1) Situation understanding stage This is the stage where the designer understands the modeling object. At this stage, the designer visualizes the model using a modeling tool or the like, and deepens the understanding of the modeling object.
(2) Design pattern selection stage The designer selects a design pattern written in UML from the design pattern catalog.
(3) Application Location Determination Stage on Model / Code The designer determines an applicable location for the selected design pattern using the design model / implementation code. At present, a function that automatically specifies the application location by a tool has not been developed, and the designer manually determines using a modeling tool.
(4) Deployment stage The components (classes, attributes, etc.) determined in the application location determination stage in (3) above and the roles that make up the design pattern (instead of specific classes, their roles and behavior are abstracted) Are associated with each other), and the associated constituent elements are converted and arranged so as to match the design pattern. Currently, there exists a modeling tool having a function of automatically converting and arranging after a designer associates components (see Non-Patent Document 1).
(5) Peripheral adjustment stage The periphery of the part where the design pattern is developed in the development stage (4) is checked for any defects compared to before development. At present, it is necessary for the designer to determine whether or not there is a final defect. Therefore, even when the components are automatically converted / arranged in the expansion stage (4), the designer determines whether there is a defect and corrects it manually.
上記のデザインパターンの適用例を、図26を参照して説明する。
まず、設計者は、(1)の状況理解段階において、図26(a)に示すクラス「A」,「B」,「C」,「D」,「E」の構成要素を抽出したものとする。
そして、(2)のデザインパターン選択段階において、設計者が、デザインパターンとして図26(b)に示す「Observerパターン」をデザインパターンカタログから選択したものとする。この「Observerパターン」は、図26(b)に示すように、4つのロール(「Subject」,「Observer」,「ConcreteSubject」,「ConcreteObserver」)から構成され、それぞれのロールは、線や矢印等で示される「関連」で結ばれている。なお、以下において、UMLの表記法として規定されているクラス間の接続関係を示す「関連」を、鍵カッコ付きの関連(「関連」)として記載する。
An application example of the above design pattern will be described with reference to FIG.
First, the designer extracts the components of the classes “A”, “B”, “C”, “D”, and “E” shown in FIG. 26A in the situation understanding stage of (1). To do.
In the design pattern selection stage (2), the designer selects the “Observer pattern” shown in FIG. 26B as a design pattern from the design pattern catalog. The “Observer pattern” is composed of four roles (“Subject”, “Observer”, “ConcreteSubject”, “ConcreteObserver”) as shown in FIG. It is tied by the “relation” shown in. In the following, “relation” indicating a connection relationship between classes defined as a UML notation is described as a relationship with key brackets (“relation”).
次に、(3)の適用箇所決定段階において、設計者は、デザインパターンの適用箇所を図26(a)に示す構成要素から決定する。ここでは、クラス「A」,「B」,「C」,「D」,「E」のすべての構成要素が、設計者により決定されたものとする。 Next, in the application location determination stage of (3), the designer determines the application location of the design pattern from the components shown in FIG. Here, it is assumed that all components of classes “A”, “B”, “C”, “D”, and “E” have been determined by the designer.
続いて、(4)の展開段階において、各構成要素とデザインパターンを構成するロールとの対応付けを行う。
ここでは、図26(c)に示すように、設計者により、クラス「A」が「Subject」に対応付けられ、クラス「C」が「Observer」に対応付けられ、クラス「B」が「ConcreteSubject」に対応付けられ、クラス「D」およびクラス「E」が「ConcreteObserver」に対応付けられる。
そして、設計者による各構成要素とデザインパターンを構成するロールとの対応付けの後、モデリングツールが、自動的に変換配置を行い、図26(d)に示すような、クラス図を設計する。つまり、図26(d)に示すクラス図は、図26(a)の構成要素を、図26(b)の「Observerパターン」のデザインパターンに適用した結果である。
Subsequently, in the development stage of (4), each component is associated with a role constituting the design pattern.
Here, as shown in FIG. 26C, the designer associates the class “A” with “Subject”, the class “C” with “Observer”, and the class “B” with “ConcreteSubject”. , And class “D” and class “E” are associated with “ConcreteObserver”.
Then, after associating each component with the role constituting the design pattern by the designer, the modeling tool automatically converts and arranges and designs a class diagram as shown in FIG. That is, the class diagram shown in FIG. 26D is a result of applying the components shown in FIG. 26A to the “Observer pattern” design pattern shown in FIG.
次に、(5)の周囲調整段階で、設計者は、図26(d)に示すクラス図の不具合の有無を判断し、不具合がある場合には、手動で修正を行う。 Next, in the surrounding adjustment stage of (5), the designer determines whether there is a defect in the class diagram shown in FIG. 26D, and if there is a defect, manually corrects it.
このように、デザインパターンを用いた現状のモデリングツールの機能は、UMLで記述されたデザインパターンを表示し、表示したデザインパターンのロールと適用したい各構成要素とを手動で対応させた後、そのデザインパターンに合致するように各構成要素の変換・配置を自動で行うことにとどまる。 As described above, the function of the current modeling tool using the design pattern is to display the design pattern described in UML, and manually associate the displayed design pattern role with each component to be applied. The conversion and placement of each component is automatically performed so as to match the design pattern.
(リファクタリング)
また、デザインパターンの適用と類似した機能として、プログラムの「リファクタリング」が知られている。このリファクタリングは、プログラムの外部から見た動作を変更せずに、ソースコードの内部構造を整理するプログラム改善技術である。しかしながら、このリファクタリングを支援するためのリファクタリングカタログを用いたツールは、通常プログラムレベルでの作業支援に限られている。
(Refactoring)
As a function similar to the application of a design pattern, “refactoring” of a program is known. This refactoring is a program improvement technique for organizing the internal structure of source code without changing the operation seen from the outside of the program. However, tools using a refactoring catalog for supporting this refactoring are usually limited to work support at the program level.
以上のように、ソースコードプログラムや実装モデル等の下流工程のソフトウェア成果物を対象とするリファクタリング支援ツールや、前記した従来のデザインパターン適用支援ツールでは、上流工程(概念モデリング工程や論理モデリング工程)のクラス図の編集におけるパターン適用やクラス図の変換を支援できなかった。
特に、デザインパターンをサポートする従来のモデリングツールは、UMLで記述されたデザインパターンカタログを単純に表示するのみであり、多くのパターンからどのパターンを選べばよいのか判断するために、デザインパターンカタログに記載されている個々のデザインパターンについての高度な知識を必要としていた。つまり、設計者は、設計対象の1つのモデルに対して、そのモデルの表現方法が複数存在するため、実際にクラス設計をしようとするとどのデザインパターン(構造)で表現すればよいか迷うことが多く、一旦、あるデザインパターンでクラス図を設計した後、別のデザインパターンに当てはめて直して最適なデザインパターンを決定するような試行錯誤が必要であり非常に大きな労力を有していた。
As described above, in the refactoring support tool for the software product of the downstream process such as the source code program and the implementation model, and the conventional design pattern application support tool described above, the upstream process (conceptual modeling process and logical modeling process) It was not possible to support pattern application and class diagram conversion in editing class diagrams.
In particular, conventional modeling tools that support design patterns simply display a design pattern catalog written in UML. To determine which pattern should be selected from many patterns, the design pattern catalog is used. It required advanced knowledge of the individual design patterns described. In other words, since there are multiple ways to represent a model for a model to be designed, the designer may be confused as to which design pattern (structure) should be represented when attempting class design. In many cases, once a class diagram is designed with a certain design pattern, trial and error is required to determine the optimum design pattern by applying it to another design pattern, which has a great deal of labor.
特に、テレコム(telecommunication)向け管理システムに関する標準技術を規定するTMForum(TMF:TeleManagement Forum)の提供する情報モデルであるSID(Shared Information and Data Model)を用いた管理システムのモデリング(TeleManagement Forum GB922, “Information Framework (SID): Concepts and Principles,” Version 7.15, March 2011.)においては、以下の特徴があり、さらに問題があった。
・SIDは概念モデルであるため、開発工程を進めるにつれて、SIDのクラス図に現れる実装に依存しない構造を、実装方式や実装する言語、ミドルウェア等を考慮した構造に変換していく必要がある。
・SIDのモデリングでは、前記したパターンカタログには見られないSID独自のパターン(デザインパターン)が適応される。特に、「Entity Characteristic Pattern」(後記する図2のパターン[4]TMF SID Spec.Char.パターン)は、あるクラスについて、属性を追加したい場合でも、既存クラスを変更せずにインスタンスの追加で対応できるという拡張性を備えたデザインパターンである。このSID独自のパターンについては、従来のデザインパターンカタログに含まれておらず、設計者がクラス図設計に利用することができなかった。
In particular, management system modeling using SID (Shared Information and Data Model), which is an information model provided by TMForum (TMF: TeleManagement Forum) that defines standard technologies for management systems for telecommunication (TeleManagement Forum GB922, “ Information Framework (SID): Concepts and Principles, “Version 7.15, March 2011.” has the following features and further problems.
Since the SID is a conceptual model, it is necessary to convert the structure that does not depend on the implementation appearing in the SID class diagram into a structure that takes into consideration the implementation method, the language to be implemented, middleware, and the like as the development process proceeds.
In SID modeling, a unique SID pattern (design pattern) that is not found in the pattern catalog is applied. In particular, “Entity Characteristic Pattern” (Pattern [4] TMF SID Spec.Char. Pattern in FIG. 2 to be described later) can be added by adding an instance without changing the existing class even if it is desired to add an attribute for a certain class. It is a design pattern with extensibility that can be done. This unique SID pattern is not included in the conventional design pattern catalog, and the designer cannot use it for class diagram design.
これらの特徴を踏まえ、SIDを用いた管理システムのモデリングを含めたオブジェクト指向のソフトウェア開発を支援するため、本実施形態に係るクラス図変換装置およびクラス図変換プログラムは、既存のデザインパターンやリファクタリングに限定されず、クラス設計時に設計者がどのデザインパターンを選択するかしばしば判断を迷いそうなパターンを対象にした。また、既存のデザインパターンやリファクタリングに関する高度な知識を必要とせず、クラス図の見直しや修正を支援することができるものとした。 Based on these characteristics, in order to support object-oriented software development including management system modeling using SID, the class diagram conversion device and class diagram conversion program according to the present embodiment are based on existing design patterns and refactoring. It was not limited, and the pattern which was likely to be in doubt about which design pattern the designer selects at the time of class design was targeted. In addition, advanced knowledge about existing design patterns and refactoring is not required, and it is possible to support review and correction of class diagrams.
<概要>
次に、本実施形態に係るクラス図変換装置1等が実行する処理の概要について説明する。本実施形態に係るクラス図変換装置1等は、一旦作成されたクラス図を精査(つまりクラス図の見直し)する際に、作成されたクラス図とは異なるパターン(デザインパターン)を提示し、その提示したパターンの中から最適なパターンを選択させ、クラス図を変換する。
<Overview>
Next, an outline of processing executed by the class
本実施形態においては、一旦あるパターンで作成されたクラス図を他のパターンのクラス図に変更するときに頻繁に出てくるパターン変更の判断(変換パターン)を類型化し、「変換パターン情報」としてクラス図変換装置1に記憶しておく。そして、一旦あるパターンで作成されたクラス図についての変換可能な他のパターンを、クラス図変換装置1に記憶した変換パターン情報に基づき表示して、設計者に変換後の他のパターンを選択させてクラス図の表示をその選択されたパターンに変換する。
In this embodiment, a pattern change judgment (conversion pattern) that frequently appears when a class diagram once created with a pattern is changed to a class diagram of another pattern is classified as “conversion pattern information”. It is stored in the class
本実施形態のクラス図変換装置1は、対象とするクラスとその「関連」のパターン(デザインパターン)として、以下の6種類を対象とする。なお、詳細は、図2〜図8を用いて後記する。
・パターン[1]:クラスと属性の関係
・パターン[2]:クラスの集約関係
・パターン[3]:クラスの集約関係+間に抽象クラス
・パターン[4]:TMF SID Spec.Char.パターン
(Entity Specification Characteristic パターン)
・パターン[5]:委譲による継承関係の実現
・パターン[6]:継承関係
The class
Pattern [1]: Relationship between class and attribute Pattern [2]: Aggregation relationship of class Pattern [3]: Aggregation relationship of class + abstract class between Patterns [4]: TMF SID Spec. Char. pattern
(Entity Specification Characteristic pattern)
Pattern [5]: Realization of inheritance relationship by delegation Pattern [6]: Inheritance relationship
このパターン[1]〜[6]のうち、相互に変換可能な以下に示す10種の変換パターンを、クラス図変換装置1が取り扱う。また、本実施形態においては、クラス図の構造を記述する際に通常異なる概念であるクラス、属性、オブジェクトに関して、クラス図を変換する処理において対等な構成要素として扱うことを特徴とする。なお、詳細は、図2,図16〜図25等を用いて後記する。
(第1変換パターン) :パターン[1]→[2]
(第2変換パターン) :パターン[2]→[1]
(第3変換パターン) :パターン[2]→[3]
(第4変換パターン) :パターン[3]→[2]
(第5変換パターン) :パターン[3]→[4]
(第6変換パターン) :パターン[4]→[3]
(第7変換パターン) :パターン[2]→[4]
(第8変換パターン) :パターン「4」→「2」
(第9変換パターン) :パターン[5]→[6]
(第10変換パターン):パターン[6]→[5]
Among the patterns [1] to [6], the class
(First conversion pattern): Pattern [1] → [2]
(Second conversion pattern): Pattern [2] → [1]
(Third conversion pattern): Pattern [2] → [3]
(Fourth conversion pattern): Pattern [3] → [2]
(Fifth conversion pattern): Pattern [3] → [4]
(Sixth conversion pattern): Pattern [4] → [3]
(Seventh conversion pattern): Pattern [2] → [4]
(Eighth conversion pattern): Pattern “4” → “2”
(9th conversion pattern): Pattern [5] → [6]
(10th conversion pattern): Pattern [6] → [5]
本実施形態において、クラス図変換装置1は、変換前のクラス図のパターンを特定し、そのパターンにおけるクラスやそのクラスの組合せ、「関連」等から、異なる表現のパターンに変換可能な変換パターン(変換後のパターン)を設計者に提示し選択させる。そして、クラス図変換装置1は、選択された変換パターンに基づき、そのクラス図のパターンを変換して表示する。
以下、クラス図変換装置1の構成を具体的に説明する。
In the present embodiment, the class
Hereinafter, the configuration of the class
<クラス図変換装置の構成>
図1は、本実施形態に係るクラス図変換装置1の構成例を示す機能ブロック図である。
クラス図変換装置1は、一旦あるパターンで作成されたクラス図に基づき、そのクラス図と同じ内容を表現する(以下、「同型表現」というときがある。)他のパターン(デザインパターン)のクラス図を表示し、設計者が選択した他のパターンのクラス図に変換して表示させる装置である。
図1に示すように、クラス図変換装置1は、入力装置3および表示装置2に接続される。入力装置3は、例えば、マウスやキーボード、タッチパネル等から構成される。また、表示装置2は、液晶ディスプレイ等から構成される。
そして、このクラス図変換装置1は、制御部10と、入出力部20(入力手段)と、メモリ部30と、記憶部40(記憶手段)とを含んで構成される。
<Configuration of class diagram conversion device>
FIG. 1 is a functional block diagram illustrating a configuration example of the class
The class
As shown in FIG. 1, the class
The class
制御部10は、一旦あるパターンで作成されたクラス図を、他のパターンのクラス図に変換して表示する制御の全般を司り、表示処理部11(表示処理手段)と入出力情報処理部12とを備える。
The control unit 10 is responsible for the overall control of converting a class diagram once created with a pattern into a class diagram of another pattern and displaying it. The display processing unit 11 (display processing means) and the input / output
表示処理部11(表示処理手段)は、クラス図の変換するための処理全般を司り、クラス図表示部111と、変換パターン表示部112と、クラス図変換処理部113とを含んで構成される。
The display processing unit 11 (display processing means) is responsible for overall processing for converting a class diagram, and includes a class
クラス図表示部111は、クラス、属性、「関連」等を示す情報であるクラス図情報100(詳細は後記)に基づき、クラス図を表示装置2に表示させ、クラス図の構成要素のうち、クラス図変換の適用箇所となる、クラスやクラスの組合せ等を、設計者に選択させる。
The class
変換パターン表示部112は、設計者が選択したクラス図変換の適用箇所について、その適用箇所が、クラスとその「関連」で示される所定のパターン(6種類のパターン)のうち、どのパターンに該当するかを特定する。そして、変換パターン表示部112は、特定したパターンについて、同型表現として変換可能な変換パターンを、後記する変換パターンデータベース42に記憶された変換パターン情報を参照して抽出し、「適用可能な変換パターンの一覧画面(変換パターン一覧画面300)」(図14,図15参照)を生成し、表示装置2に表示させる。そして、変換パターン表示部112は、「適用可能な変換パターンの一覧画面(変換パターン一覧画面300)」に基づく、変換パターンの選択情報を受け付ける。
The conversion
クラス図変換処理部113は、取得した変換パターンの選択情報に基づき、適用箇所となるクラス図の構成要素を、選択された変換パターンに基づき変換し、変換後のクラス図を生成して、表示装置2に表示させる。
Based on the acquired conversion pattern selection information, the class diagram
入出力情報処理部12は、入力装置3から入出力部20を介して取得した入力情報を、表示処理部11に引き渡し、表示処理部11からの出力情報を、入出力部20を介して表示装置2に送信する。
The input / output
入出力部20(入力手段)は、入力装置3であるマウスやキーボード、タッチパネル等から制御部10の処理に関する情報(選択情報等)を受け付ける。また、制御部10が生成したクラス図に関する情報を表示装置2に出力する。なお、この入出力部20は、入力インタフェースと出力インタフェースとから構成される。
The input / output unit 20 (input unit) receives information (selection information and the like) related to processing of the control unit 10 from a mouse, a keyboard, a touch panel, or the like that is the
メモリ部30は、RAM(Random Access Memory)等の記憶手段からなり、制御部10の処理に必要な情報を一時的に記憶する。
The
記憶部40(記憶手段)は、クラス図を生成するために必要な情報であるクラス図情報100(後記する図3〜図8参照)を格納するクラス図情報データベース41と、変換パターンデータベース42とが記憶される。
The storage unit 40 (storage means) includes a class
このクラス図情報100には、クラス図を表示装置2に表示するための情報として、図3〜図8等に示すように、関連種別101、関連ID102、From要素種別103、From要素ID104、To要素種別105、To要素ID106、From要素名107、To要素名108および表示関連情報109のデータ項目が含まれる。
関連種別101は、クラス図の構成要素間の「関連」の種別が格納され、例えば、クラスとそのクラスの属性との関係であることを示す「属性(CLASS-ATTRIBUTE)」、クラス間が全体−部分の関係であることを示す「集約(AGGREGATION)」、あるクラスの特性(属性、操作)を他のクラスが引き継ぐことを示す「継承(INHERITANCE)」、あるクラスとそのクラスの実例を示すオブジェクトとの関係であることを示す「インスタンス(CLASS-INSTANCE)」が格納される。
関連ID102は、そのクラス図(クラス図情報100)内において、その構成要素間の「関連」に固有な識別子である。
In this class diagram information 100, as information for displaying the class diagram on the
The
The
From要素種別103には、あるクラス図内の注目する2つの構成要素のうち、上位側の構成要素の種別が格納され、例えば、クラス、属性、オブジェクトが格納される。
また、From要素ID104には、From要素種別103の構成要素について、そのクラス図(クラス図情報100)内で固有な識別子が格納される。
なお、クラス図情報100のFrom要素種別103およびFrom要素ID104で示される構成要素(クラス)を、以下において、「上位のクラス」と呼ぶことがある。
The
The
Note that the component (class) indicated by the
To要素種別105には、あるクラス図内の注目する2つの構成要素のうち、下位側の構成要素の種別が格納され、例えば、クラス、属性、オブジェクトが格納される。
また、To要素ID106には、To要素種別105の構成要素について、そのクラス図(クラス図情報100)内で固有な識別子が格納される。
なお、クラス図情報100のTo要素種別105およびTo要素ID106で示される構成要素(クラス)を、以下において、「下位のクラス」と呼ぶことがある。
The
The
The component (class) indicated by the
From要素名107には、From要素種別103およびFrom要素ID104で示される構成要素の具体的な名称が格納される。
また、To要素名108には、To要素種別105およびTo要素ID106で示される構成要素の具体的な名称が格納される。
The
The
表示関連情報109には、クラス図を画面上に表示させる形状や位置情報等が格納される。例えば、クラスの画面上での形状(四角形等)や、画面上での位置情報(例えば、四角形であれば4点の座標情報)等が格納される。また、構成要素間を結ぶ線で示される「関連」の形状として、「継承」であれば白抜き三角(△)の矢印、「集約」であれば、全体を示すクラス側に白抜きのひし形(◇)等が格納され、構成要素間に方向性がある場合には、矢印の向きに関する情報等が格納される。
The display related
なお、本実施形態においては、クラス、属性、オブジェクトのそれぞれを、クラス図を変換する処理の対象となる構成要素として扱うため、From要素種別103およびTo要素種別105において、クラス図の構造を記述する際に通常異なる概念とされるクラス、属性およびオブジェクトが、対等な情報として記憶される。
In this embodiment, the class diagram structure is described in the
図1に戻り、変換パターンデータベース42には、クラス図から選択された変換対象の適用箇所が所定のパターン(6種類のパターン)のうちどのパターンに該当するかを特定するためのパターン判定ロジックと、同型表現として相互に変換可能な前記した10種の変換パターンを示す変換パターン情報とが記憶される(詳細は、後記する。)。なお、このパターン判定ロジックには、具体的には、クラス図から変換対象の適用箇所として選択されたある1つのクラスについて、そのクラスが格納されたレコードが所定のパターン(6種類のパターン)に含まれる可能性があるか否かを決定するためのロジックと、クラス図から変換対象の適用箇所として複数のクラスの組合せが選択された場合に、その複数のクラスの組合せを所定のパターン(6種類のパターン)と特定するためのロジックとが記憶される。
Returning to FIG. 1, in the
なお、記憶部40は、ハードディスク、フラッシュメモリ等の記憶手段からなり、制御部10の処理を行うためのプログラム(クラス図変換プログラム)等を記憶する。
また、この制御部10の機能は、例えばクラス図変換装置1の記憶部40に記憶されたプログラム(クラス図変換プログラム)をCPU(Central Processing Unit)がメモリ部30に展開し実行することで実現される。
The storage unit 40 includes storage means such as a hard disk and a flash memory, and stores a program (class diagram conversion program) for performing the processing of the control unit 10 and the like.
The function of the control unit 10 is realized, for example, by a CPU (Central Processing Unit) developing and executing a program (class diagram conversion program) stored in the storage unit 40 of the class
ここで、クラスとのその「関連」で示される6種類のパターン(デザインパターン)と、同型表現として相互に変換可能な前記した10種の変換パターンについて、具体的に説明する。 Here, the six types of patterns (design patterns) indicated by the “association” with the class and the above-described ten types of conversion patterns that can be mutually converted as the same type expression will be specifically described.
(6種のパターンの詳細)
図2は、本実施形態に係るクラス図変換装置1が取り扱う同型表現のパターンを説明するための図である。図2においては、クラスとクラス間の「関連」等で示される6種類のパターンと、同型表現であるパターンの組合せ、つまり、変換可能なパターン(変換パターン)を示している。
(Details of 6 patterns)
FIG. 2 is a diagram for explaining patterns of isomorphic expressions handled by the class
≪パターン[1]≫
図2に示すように、パターン[1]は、「クラスと属性の関係」を示す。UMLの記載方式に基づき、クラスは画面上での形状として四角形で表現され、そのクラスのクラス名(図2の[1]では、「クラスA」)と、そのクラスの属性名(図2の[1]では、「属性a」,「属性b」,「属性c」)が表示される。
≪Pattern [1] ≫
As shown in FIG. 2, the pattern [1] indicates “relationship between class and attribute”. Based on the UML description method, a class is represented by a rectangle as a shape on the screen, and the class name of the class (“Class A” in [1] in FIG. 2) and the attribute name of the class (in FIG. 2). In [1], “attribute a”, “attribute b”, “attribute c”) are displayed.
このパターン[1]の「クラスと属性の関係」を、画面上に生成するためのクラス図情報100(100a)を図3に示す。図3は、クラス図情報データベース41に格納されるパターン[1]のクラス図情報100(100a)の一例を示す図である。
パターン[1]のクラス図情報100(100a)には、例えば、第1行目に示すように、関連種別101として「属性(CLASS-ATTRIBUTE)」が格納され、関連ID102に「1(1−1)」、From要素種別103に「クラス」、From要素ID104に「A」、To要素種別105に「属性」、To要素ID106に「a」が格納される。つまり、クラス「A」と属性「a」との関係が、「属性(CLASS-ATTRIBUTE)」であることを示す情報が格納される。なお、属性「b」および属性「c」についても同様である。
なお、変換パターンデータベース42に格納されるパターン判定ロジックには、クラス図から変換対象の適用箇所として選択されたある1つのクラスについて、そのクラスが格納されたレコードがパターン[1]に含まれる可能性があるか否かを決定するためのロジックとして、クラス図情報100のそのレコードの関連種別101が「属性(CLASS-ATTRIBUTE)」の情報であり、かつ、そのレコードのFrom要素種別103が「クラス」であり、To要素種別105が「属性」であること(ロジック1−1)、が格納される。また、クラス図から変換対象の適用箇所として複数のクラスの組合せが選択された場合に、その複数のクラスの組合せをパターン[1]と特定するためのロジックとして、その複数のクラスを格納する各レコードにおいて、それぞれが前記した(ロジック1−1)の条件を満たし、かつ、各レコードのFrom要素ID104が同一であること(ロジック1−2)、が格納される。
FIG. 3 shows class diagram information 100 (100a) for generating the “relationship between class and attribute” of the pattern [1] on the screen. FIG. 3 is a diagram showing an example of the class diagram information 100 (100a) of the pattern [1] stored in the class
In the class diagram information 100 (100a) of the pattern [1], for example, as shown in the first row, “attribute (CLASS-ATTRIBUTE)” is stored as the
Note that the pattern determination logic stored in the
≪パターン[2]≫
図2に示すパターン[2]は、「クラスの集約関係」を示す。集約(AGGREGATION)は、全体を示すクラス側に白抜きのひし形(◇)が付された線でクラス間が接続される。そして、クラス「a」、クラス「b」およびクラス「c」が、クラス「A」(全体)の部分である関係を示す。
≪Pattern [2] ≫
Pattern [2] shown in FIG. 2 indicates “class aggregation relationship”. In aggregation (AGGREGATION), classes are connected by a line with a white diamond (◇) on the class side indicating the whole. The class “a”, the class “b”, and the class “c” indicate a relationship that is a part of the class “A” (entire).
このパターン[2]の「クラスの集約関係」を、画面上に生成するためのクラス図情報100(100b)を図4に示す。図4は、クラス図情報データベース41に格納されるパターン[2]のクラス図情報100(100b)の一例を示す図である。
パターン[2]のクラス図情報100(100b)には、例えば、第1行目に示すように、関連種別101として「集約(AGGREGATION)」が格納され、関連ID102に「2(2−1)」、From要素種別103に「クラス」、From要素ID104に「A」、To要素種別105に「クラス」、To要素ID106に「a」が格納される。つまり、クラス「A」とクラス「a」とが集約(全体−部分)の関係にあることを示す情報が格納される。なお、クラス「b」およびクラス「c」についても同様である。よって、クラス「A」がクラス「a」,「b」,「c」を集約する関係にあることを示す。
なお、変換パターンデータベース42に格納されるパターン判定ロジックには、クラス図から変換対象の適用箇所として選択されたある1つのクラスについて、そのクラスが格納されたレコードがパターン[2]に含まれる可能性があるか否かを決定するためのロジックとして、クラス図情報100のそのレコードの関連種別101が「集約(AGGREGATION)」の情報であり、かつ、そのレコードのFrom要素種別103が「クラス」であり、To要素種別105が「クラス」であること(ロジック2−1)、が格納される。また、クラス図から変換対象の適用箇所として複数のクラスの組合せが選択された場合に、その複数のクラスの組合せをパターン[2]と特定するためのロジックとして、その複数のクラスを格納する各レコードにおいて、それぞれが前記した(ロジック2−1)の条件を満たし、かつ、各レコードのFrom要素ID104が同一であること(ロジック2−2)、が格納される。
FIG. 4 shows class diagram information 100 (100b) for generating the “class aggregation relationship” of this pattern [2] on the screen. FIG. 4 is a diagram illustrating an example of the class diagram information 100 (100b) of the pattern [2] stored in the class
In the class diagram information 100 (100b) of the pattern [2], for example, “AGGREGATION” is stored as the
Note that the pattern determination logic stored in the
≪パターン[3]≫
図2に示すパターン[3]は、「クラスの集約関係+間に抽象クラス」を示す。この抽象クラス(図2の[3]では、「クラスR」)は、その下位のクラス(図2の[3]では、「クラスa」、「クラスb」および「クラスc」)に共通する属性、操作、役割等を1つのクラスとしてまとめたものであり、その下位のクラスは、上位のクラスである抽象クラスを継承するものとして表現される。そして、その抽象クラス(クラス「R」)がさらに上位のクラス(図2の[3]では、クラス「A」)に、集約される関係であることを示す。
≪Pattern [3] ≫
The pattern [3] illustrated in FIG. 2 indicates “abstract class between classes + abstract class”. This abstract class (“Class R” in [3] in FIG. 2) is common to its lower classes (“Class a”, “Class b”, and “Class c” in [3] in FIG. 2). Attributes, operations, roles, and the like are collected as one class, and a lower class is expressed as inheriting an abstract class that is a higher class. The abstract class (class “R”) indicates a relationship that is aggregated into a higher class (class “A” in [3] in FIG. 2).
このパターン[3]の「クラスの集約関係+間に抽象クラス」を、画面上に生成するためのクラス図情報100(100c)を図5に示す。図5は、クラス図情報データベース41に格納されるパターン[3]のクラス図情報100(100c)の一例を示す図である。
パターン[3]のクラス図情報100(100c)には、例えば、第1行目に、関連種別101として「集約(AGGREGATION)」が格納され、関連ID102に「2」、From要素種別103に「クラス」、From要素ID104に「A」、To要素種別105に「クラス」、To要素ID106に「R」が格納される。
また、第2行目に、関連種別101として「継承(INHERITANCE)」が格納され、関連ID102に「3(3−1)」、From要素種別103に「クラス」、From要素ID104に「R」、To要素種別105に「クラス」、To要素ID106に「a」が格納される。なお、第3行目と第4行目についても、同様に格納され、それぞれTo要素ID106に「b」,「c」が格納される。
よって、クラス「A」がクラス「R」を集約し、クラス「a」,「b」,「c」が、クラス「R」を継承する関係にあることを示す。
なお、変換パターンデータベース42に格納されるパターン判定ロジックには、クラス図から変換対象の適用箇所として選択されたある1つのクラスについて、そのクラスが格納されたレコードがパターン[3]に含まれる可能性があるか否かを決定するため、および、クラス図から変換対象の適用箇所として複数のクラスの組合せが選択された場合に、その複数のクラスの組合せをパターン[3]と特定するためのロジックとして、クラス図情報100のその選択されたクラスが含まれる複数のレコード中に、関連種別101が「集約(AGGREGATION)」のレコードと「継承(INHERITANCE)」のレコードとがそれぞれ少なくとも1つ存在し、集約のレコードのTo要素ID106と継承のレコードのFrom要素ID104が同一であること、が格納される。
FIG. 5 shows class diagram information 100 (100c) for generating “class aggregation relationship + abstract class between” of the pattern [3] on the screen. FIG. 5 is a diagram illustrating an example of the class diagram information 100 (100c) of the pattern [3] stored in the class
In the class diagram information 100 (100c) of the pattern [3], for example, “AGGREGATION” is stored as the
In the second row, “INHERITANCE” is stored as the
Therefore, the class “A” aggregates the class “R”, and the classes “a”, “b”, and “c” have a relationship of inheriting the class “R”.
Note that the pattern determination logic stored in the
≪パターン[4]≫
図2に示すパターン[4]は、「TMF SID Spec.Char.パターン」を示す。この「TMF SID Spec.Char.パターン」は、SID独自のパターンであり、このパターンに特有なクラスは、そのクラスの含まれる情報としてそのクラスの具体的なオブジェクトが対応付けられる。
図2の[4]に示す例では、クラス「SA」がオブジェクト「A」をデータとして備えていること、そして、クラス「SA」がクラス「SAC」を集約する関係にあること、クラス「SAC」がオブジェクト「a」,「b」,「c」をデータとして備えていること、を示している。
≪Pattern [4] ≫
The pattern [4] shown in FIG. 2 indicates a “TMF SID Spec.Char. Pattern”. This “TMF SID Spec.Char. Pattern” is a unique SID pattern, and a class specific to this pattern is associated with a specific object of the class as information included in the class.
In the example shown in [4] of FIG. 2, the class “SA” includes the object “A” as data, and the class “SA” has a relationship of aggregating the class “SAC”, and the class “SAC”. "Includes objects" a "," b ", and" c "as data.
このパターン[4]の「TMF SID Spec.Char.パターン」を、画面上に生成するためのクラス図情報100(100d)を図6に示す。図6は、クラス図情報データベース41に格納されるパターン[4]のクラス図情報100(100d)の一例を示す図である。
パターン[4]のクラス図情報100(100d)には、例えば、第1行目に、関連種別101として「インスタンス(CLASS-INSTANCE)」が格納され、関連ID102に「4(4−1)」、From要素種別103に「クラス」、From要素ID104に「SA」、To要素種別105に「オブジェクト」、To要素ID106に「A」が格納される。
また、第2行目に、関連種別101として「集約(AGGREGATION)」が格納され、関連ID102に「2」、From要素種別103に「クラス」、From要素ID104に「SA」、To要素種別105に「クラス」、To要素ID106に「SAC」が格納される。
第3行目には、関連種別101として「インスタンス(CLASS-INSTANCE)」が格納され、関連ID102に「4(4−2)」、From要素種別103に「クラス」、From要素ID104に「SAC」、To要素種別105に「オブジェクト」、To要素ID106に「a」が格納される。なお、第4行目と第5行目についても、同様に格納され、それぞれTo要素ID106に「b」,「c」が格納される。
なお、変換パターンデータベース42に格納されるパターン判定ロジックには、クラス図から変換対象の適用箇所として複数のクラスの組合せが選択された場合に、その複数のクラスの組合せをパターン[4]と特定するためのロジックとして、クラス図情報100の複数のレコード中に、関連種別101が「集約(AGGREGATION)」のレコードと「インスタンス(CLASS-INSTANCE)」のレコードとがそれぞれ少なくとも1つ存在し、集約のレコードのFrom要素種別103およびFrom要素ID104に示されるクラスと同一のクラスがインスタンスのレコードのFrom要素種別103およびFrom要素ID104に存在すること、また、集約のレコードのTo要素種別105およびTo要素ID106に示されるクラスと同一のクラスが他のインスタンスのレコードのFrom要素種別103およびFrom要素ID104に存在すること、が格納される。
FIG. 6 shows class diagram information 100 (100d) for generating the “TMF SID Spec.Char. Pattern” of this pattern [4] on the screen. FIG. 6 is a diagram illustrating an example of the class diagram information 100 (100d) of the pattern [4] stored in the class
In the class diagram information 100 (100d) of the pattern [4], for example, “Instance (CLASS-INSTANCE)” is stored as the
In the second row, “AGGREGATION” is stored as the
In the third row, “Instance (CLASS-INSTANCE)” is stored as the
In the pattern determination logic stored in the
≪パターン[5]≫
図2に示すパターン[5]は、「委譲による継承関係の実現」を示す。ここで、「委譲」とは、自クラス(オブジェクト)に依頼されたメッセージを、他のクラス(オブジェクト)に処理を委ねることをいう。図2の[5]に示す例では、クラス「B」とクラス「A」とが、委譲の関係であり、クラス「B」がクラス「A」に処理を委ねることを示している。なお、クラス図においてこの委譲の関係は、例えば、図2の[5]に示すように、委譲元を示すクラス側に集約を示す白抜きのひし形(◇)が付され、委譲先を示すクラス側に矢印(→)が付された線で接続されて表現される。
≪Pattern [5] ≫
Pattern [5] shown in FIG. 2 indicates “realization of inheritance relationship by delegation”. Here, “delegation” refers to entrusting processing of a message requested to its own class (object) to another class (object). In the example shown in [5] of FIG. 2, the class “B” and the class “A” have a delegation relationship, and the class “B” entrusts processing to the class “A”. In the class diagram, for example, as shown in [5] of FIG. 2, this delegation relationship is a class in which a white rhombus (◇) indicating aggregation is attached to the class side indicating the delegation source and the delegation destination is indicated. It is expressed by being connected by a line with an arrow (→) on the side.
このパターン[5]の「委譲による継承関係の実現」を、画面上に生成するためのクラス図情報100(100e)を図7に示す。図7は、クラス図情報データベース41に格納されるパターン[5]のクラス図情報100(100e)の一例を示す図である。
パターン[5]のクラス図情報100(100e)には、第4行目に、関連種別101として「集約(AGGREGATION)」が格納され、関連ID102に「2」、From要素種別103に「クラス」、From要素ID104に「B」、To要素種別105に「クラス」、To要素ID106に「A」が格納される。そして、表示関連情報109に、クラス「B」からクラス「A」に向けて矢印(→)があること(図7においては、「B」→「A」(委譲)と示す。)が格納される。
なお、変換パターンデータベース42に格納されるパターン判定ロジックには、クラス図から変換対象の適用箇所として選択されたある1つのクラスについて、そのクラスが格納されたレコードがパターン[5]に含まれるか否かを決定するためのロジックとして、クラス図情報100のそのレコードの関連種別101が「集約(AGGREGATION)」の情報であり、かつ、その集約のレコードのFrom要素種別103およびTo要素種別105が「クラス」であり、さらに、その集約のレコードの表示関連情報109に委譲先を示す矢印の情報が存在すること(ロジック5−1)、が格納される。また、クラス図から変換対象の適用箇所として複数のクラスの組合せが選択された場合に、その複数のクラスの組合せをパターン[5]と特定するためのロジックとして、その複数のクラスを格納する各レコードにおいて、それぞれが前記した(ロジック5−1)の条件を満たし、かつ、各レコードのFrom要素ID104が同一であること(ロジック5−2)、が格納される。
FIG. 7 shows class diagram information 100 (100e) for generating the “realization of inheritance relationship by delegation” of this pattern [5] on the screen. FIG. 7 is a diagram showing an example of the class diagram information 100 (100e) of the pattern [5] stored in the class
In the class diagram information 100 (100e) of pattern [5], “AGGREGATION” is stored as the
Note that the pattern determination logic stored in the
≪パターン[6]≫
図2に示すパターン[6]は、「継承関係」を示す。図2の[6]に示す例では、クラス「B」がクラス「A」を継承する関係にあることを示している。
≪Pattern [6] ≫
Pattern [6] shown in FIG. 2 indicates “inheritance relationship”. The example shown in [6] of FIG. 2 indicates that the class “B” has a relationship of inheriting the class “A”.
このパターン[6]の「継承関係」を、画面上に生成するためのクラス図情報100(100f)を図8に示す。図8は、クラス図情報データベース41に格納されるパターン[6]のクラス図情報100(100f)の一例を示す図である。
パターン[6]のクラス図情報100(100f)には、第4行目に、関連種別101として「継承(INHERITANCE)」が格納され、関連ID102に「3」、From要素種別103に「クラス」、From要素ID104に「A」、To要素種別105に「クラス」、To要素ID106に「B」が格納される。これにより、クラス「B」がクラス「A」を継承する関係であることを示す。
なお、変換パターンデータベース42に格納されるパターン判定ロジックには、クラス図から変換対象の適用箇所として選択されたある1つのクラスについて、そのクラスが格納されたレコードがパターン[6]に含まれるか否かを決定するためのロジックとして、クラス図情報100のそのレコードの関連種別101が「継承(INHRITANCE)」の情報であり、かつ、その継承のレコードのFrom要素種別103およびTo要素種別105が「クラス」であること(ロジック6−1)、が格納される。また、クラス図から変換対象の適用箇所として複数のクラスの組合せが選択された場合に、その複数のクラスの組合せをパターン[6]と特定するためのロジックとして、その複数のクラスを格納する各レコードにおいて、それぞれが前記した(ロジック6−1)の条件を満たし、かつ、各レコードのFrom要素ID104が同一であること(ロジック6−2)、が格納される。
FIG. 8 shows class diagram information 100 (100f) for generating the “inheritance relationship” of this pattern [6] on the screen. FIG. 8 is a diagram illustrating an example of the class diagram information 100 (100f) of the pattern [6] stored in the class
In the class diagram information 100 (100f) of the pattern [6], “INHERITANCE” is stored as the
Note that the pattern determination logic stored in the
なお、変換対象の適用箇所のパターンを判定する場合に、図3に示したパターン[1]の「クラスと属性の関係」のクラス図情報100(100a)のように、関連種別101が「属性(CLASS-ATTRIBUTE)」のレコードのみの場合は、(ロジック1−1)または(ロジック1−2)に基づき、パターン[1]に関する判定を行う。一方、対象となるクラス図情報100のレコードに、「属性(CLASS-ATTRIBUTE)」のレコードと、それ以外の「関連」のレコードが混在する場合には(例えば、図8参照)、属性のレコードは、その属性を備えるクラスと一体なものとして、その属性のレコードを判断対象とせずに、属性以外の「関連」のレコードについて、パターン[2]〜パターン[6]に関する判定を行う。
When determining the pattern of the application location to be converted, the
(同型表現の変換パターン)
次に、同じく図2を参照して、前記した6種類のパターンのうち、同型表現として相互に変換可能な組合せである変換パターンについて説明する。なお、図2において、同型表現であり、相互に変換可能なパターンについて、その間に両矢印(⇔)を示している。
(Conversion pattern of isomorphic expression)
Next, a conversion pattern which is a combination that can be mutually converted as the same type expression among the above-described six types of patterns will be described with reference to FIG. In FIG. 2, double arrows (⇔) are shown between patterns that are of the same type and can be converted to each other.
同型表現の変換パターンには、前記したように10種の組合せがある。以下、具体的に説明する。 As described above, there are 10 combinations of conversion patterns of the same type expression. This will be specifically described below.
図2に示すように、パターン[1]の「クラスと属性の関係」とパターン[2]の「クラスの集約関係」とは、相互に変換可能である。
これは、パターン[1]のクラス「A」が備える各属性の要素は、パターン[2]のように、その属性をクラスの概念で捉え直してクラスAに集約させることと、同等であると捉えられる場合があることによる(第1変換パターン:パターン[1]→[2])。また、逆に、パターン[2]の集約関係で示される下位のクラスを、パターン[1]のように、上位のクラスの属性として捉え直すことができる場合がある(第2変換パターン:パターン[2]→[1])。
As shown in FIG. 2, the “class and attribute relationship” of pattern [1] and the “class aggregation relationship” of pattern [2] can be converted into each other.
This is equivalent to the element of each attribute included in the class “A” of the pattern [1] being reconstituted with the class concept and aggregated in the class A as in the pattern [2]. (First conversion pattern: pattern [1] → [2]). Conversely, the lower class indicated by the aggregation relation of pattern [2] may be reconsidered as an attribute of the upper class as in pattern [1] (second conversion pattern: pattern [ 2] → [1]).
図2に示すように、パターン[2]の「クラスの集約関係」とパターン[3]の「クラスの集約関係+間に抽象クラス」とは、相互に変換可能である。
これは、パターン[2]の「クラスの集約関係」における下位のクラスを、パターン[3]のように、下位のクラスに共通する属性、操作、役割等を抽出して新規に抽象クラスを設け、その抽象クラスに、下位のクラスを継承させることと、同等であると捉えられる場合があることによる(第3変換パターン:パターン[2]→[3])。また、逆に、パターン[3]のように下位のクラスに共通する属性、操作、役割等を継承関係を用いて抽象クラスとしてまとめず、パターン[2]のように、個々の下位のクラスと上位のクラスとを集約関係として捉えることもできる場合がある(第4変換パターン:パターン[3]→[2])。
As shown in FIG. 2, the “class aggregation relationship” of pattern [2] and the “class aggregation relationship + abstract class” of pattern [3] can be converted into each other.
This is because the lower class in the “Class Aggregation Relationship” of pattern [2] is extracted and the attributes, operations, roles, etc. common to the lower class are extracted and a new abstract class is provided as in pattern [3]. This is because the abstract class may be regarded as equivalent to inheriting a lower class (third conversion pattern: pattern [2] → [3]). Conversely, the attributes, operations, roles, etc. common to the lower classes as in pattern [3] are not collected as an abstract class using inheritance relationships, and individual lower classes and patterns as in pattern [2]. In some cases, higher classes can be regarded as an aggregated relationship (fourth conversion pattern: pattern [3] → [2]).
図2に示すように、パターン[3]の「クラスの集約関係+間に抽象クラス」とパターン[4]の「TMF SID Spec.Char.パターン」とは、相互に変換可能である。
これは、パターン[3]に示される抽象クラス以外のクラスそれぞれを、インスタンス化してオブジェクトとし、パターン[4]に示すように、上位のクラスのデータとして包含させることができる場合があることによる(第5変換パターン:パターン[3]→[4])。また、逆に、パターン[4]のようにインスタンス化したオブジェクトを、パターン[3]のように、脱インスタンス化し、クラスとして表現することができる場合がある(第6変換パターン:パターン[4]→[3])。
As shown in FIG. 2, the “class aggregation relationship + abstract class” of pattern [3] and the “TMF SID Spec.Char. Pattern” of pattern [4] can be converted into each other.
This is because each class other than the abstract class shown in the pattern [3] may be instantiated into an object, and may be included as higher class data as shown in the pattern [4] ( Fifth conversion pattern: pattern [3] → [4]). Conversely, an object instantiated as in pattern [4] may be deinstantiated and expressed as a class as in pattern [3] (sixth conversion pattern: pattern [4]). → [3]).
図2に示すように、パターン[2]の「クラスの集約関係」とパターン[4]の「TMF SID Spec.Char.パターン」とは、相互に変換可能である。
これは、パターン[2]に示されるクラスそれぞれを、インスタンス化してオブジェクトとし、パターン[4]に示すように、そのオブジェクトに共通な属性等を新規な上位のクラスとして包含させることができる場合があることによる(第7変換パターン:パターン[2]→[4])。また、逆に、パターン[4]のようにインスタンス化したオブジェクトを、パターン[2]のように、脱インスタンス化し、オブジェクトに共通な属性等を上位のクラスとせずに、個々のクラスとして表現することができる場合がある(第8変換パターン:パターン[4]→[2])。
As shown in FIG. 2, the “class aggregation relationship” of pattern [2] and the “TMF SID Spec.Char. Pattern” of pattern [4] can be converted into each other.
This is because there are cases where each class shown in pattern [2] is instantiated into an object, and as shown in pattern [4], attributes common to the object can be included as a new higher class. This is due to the fact (seventh conversion pattern: pattern [2] → [4]). Conversely, an object instantiated as in pattern [4] is de-instantiated as in pattern [2], and attributes and the like common to the objects are expressed as individual classes without being a higher class. (8th conversion pattern: pattern [4] → [2]).
図2に示すように、パターン[5]の「委譲による継承関係の実現」とパターン[6]の「継承関係」とは、相互の変換可能である。
これは、例えば、クラス「B」がクラス「A」に処理を委ねる、つまり、委譲関係にある場合に、クラス「A」とクラス「B」とは継承関係にある、つまり、クラス「A」の特性(属性、操作)をクラス「B」が引き継ぐ関係として表現できる場合があることによる(第9変換パターン:パターン[5]→[6])。また、逆に、パターン[6]に示すように、クラス「B」がクラス「A」の特性(属性、操作)を継承する場合に、クラス「B」がクラス「A」に処理を委ねる関係、つまり、委譲関係として表現できる場合がある(第10変換パターン:パターン[6]→[5])。
As shown in FIG. 2, “realization of inheritance relationship by delegation” of pattern [5] and “inheritance relationship” of pattern [6] can be converted into each other.
This is because, for example, when class “B” delegates processing to class “A”, that is, in a delegation relationship, class “A” and class “B” are in an inheritance relationship, that is, class “A”. (9th conversion pattern: pattern [5] → [6]). On the other hand, as shown in pattern [6], when class “B” inherits the characteristics (attributes, operations) of class “A”, class “B” entrusts processing to class “A”. That is, there are cases where it can be expressed as a delegation relationship (tenth conversion pattern: pattern [6] → [5]).
なお、本実施形態において示した6種類のパターンに基づく、クラス図変換処理である第1変換パターン〜第10変換パターン以外にも、他のパターン(デザインパターン)を処理対象としてもよいし、他の変換パターンを実行するようにしてもよい。 In addition to the first conversion pattern to the tenth conversion pattern, which is the class diagram conversion process based on the six types of patterns shown in the present embodiment, other patterns (design patterns) may be processed. These conversion patterns may be executed.
変換パターンの他の具体例として、図9に示すように、パターン[2]の「クラスの集約関係」がパターン[5]の「委譲による継承関係の実現」と相互に変換可能なものとする変換パターンを考えることができる。これは、パターン[2]の集約(全体−部分)で示される上位のクラス(図9の「クラスA」)と下位のクラス(図9の「クラスa,b,c」)の関係を有する場合に、上位のクラスが下位のクラスに処理を委ねる関係、つまり、委譲関係として表現できる場合があることによる(以下、「第11変換パターン:パターン[2]→[5]」と呼ぶ。)。また、逆に、パターン[5]に示すように、上位のクラス(「クラスA」)が下位のクラス(「クラスa,b,c」)に処理を委譲する関係にある場合に、その上位のクラスが下位のクラスを集約する関係であることと、同等であると捉えられる場合があることによる(以下、「第12変換パターン:パターン[5]→[2]」と呼ぶ。)。
なお、この第11変換パターンにより、パターン[2]が変換された後のパターン[5]の「委譲による継承関係の実現」を、画面上に生成するためのクラス図情報100(100g)を図10に示す。図10に示すように、パターン[5]の「委譲による継承関係の実現」のクラス図情報100(100g)は、図4に示した、パターン[2]の「クラスの集約関係」のクラス図情報100(100b)の集約のレコードの表示関連情報109の項目に、上位のクラスから下位のクラスに向けて委譲を示す矢印(→)が格納される。
本実施形態に係るクラス図変換装置1は、この第11変換パターン(パターン[2]→[5])および第12変換パターン(パターン[5]→[2])を、前記した変換パターン情報に含めるようにすることもできる。
As another specific example of the conversion pattern, as shown in FIG. 9, the “class aggregation relationship” of the pattern [2] can be mutually converted with the “realization of the inheritance relationship by delegation” of the pattern [5]. A conversion pattern can be considered. This has a relationship between the upper class (“class A” in FIG. 9) and the lower class (“class a, b, c” in FIG. 9) indicated by the aggregation (whole-part) of pattern [2]. In some cases, the upper class may be expressed as a relationship that delegates processing to the lower class, that is, a delegation relationship (hereinafter referred to as “11th conversion pattern: pattern [2] → [5]”). . Conversely, as shown in pattern [5], when the upper class ("class A") is in a relationship of delegating processing to the lower class ("class a, b, c"), the upper class This is because there is a case where these classes are considered to be equivalent to the relationship in which lower classes are aggregated (hereinafter referred to as “twelfth conversion pattern: pattern [5] → [2]”).
Note that the class diagram information 100 (100g) for generating “realization of inheritance relationship by delegation” of the pattern [5] after the pattern [2] has been converted by the eleventh conversion pattern is displayed on the screen. 10 shows. As shown in FIG. 10, the class diagram information 100 (100g) of “realization of inheritance relationship by delegation” of pattern [5] is the class diagram of “class aggregation relationship” of pattern [2] shown in FIG. An arrow (→) indicating delegation from the higher class to the lower class is stored in the item of the display
The class
以上説明した第1変換パターン〜第10変換パターンにおいて6種類のパターンそれぞれに注目すると、次に示すような、変換前のパターンから変換後のパターンに変換可能な「変換パターン情報」として捉えることができる。 When attention is paid to each of the six types of patterns in the first conversion pattern to the tenth conversion pattern described above, it can be understood as “conversion pattern information” that can be converted from the pattern before conversion to the pattern after conversion as shown below. it can.
パターン[1]→[2]
パターン[2]→[1],[3],[4]
パターン[3]→[2],[4]
パターン[4]→[2],[3]
パターン[5]→[6]
パターン[6]→[5]
Pattern [1] → [2]
Pattern [2] → [1], [3], [4]
Pattern [3] → [2], [4]
Pattern [4] → [2], [3]
Pattern [5] → [6]
Pattern [6] → [5]
この変換パターン情報は、例えば、パターン[2]に着目したとき、そのパターン[2]において表現されるクラス図が、パターン[1],[3],[4]に変換可能であることを示す。
なお、この変換パターン情報が、変換パターンデータベース42(図1参照)に格納される。
For example, when attention is paid to the pattern [2], the conversion pattern information indicates that the class diagram expressed in the pattern [2] can be converted into the patterns [1], [3], and [4]. .
This conversion pattern information is stored in the conversion pattern database 42 (see FIG. 1).
そして、本実施形態に係るクラス図変換装置1は、変換前のクラス図のパターンが、パターン[1]〜パターン[6]のいずれかであると判定した場合に、変換パターンデータベース42に格納された変換パターン情報を参照し、その判定されたパターンについて変換可能な上記の変換パターンを表示して設計者に選択させる。そして、クラス図変換装置1は、その選択されたパターンにクラス図を変換し表示する。
When the class
<クラス図変換処理>
次に、本実施形態に係るクラス図変換装置1が実行するクラス図変換処理について説明する。
<Class diagram conversion process>
Next, a class diagram conversion process executed by the class
図11は、本実施形態に係るクラス図変換装置1が実行する、クラス図変換処理の流れを示すフローチャートである。なお、クラス図変換装置1の記憶部40のクラス図情報データベース41には、変換前のクラス図を構成するための情報であるクラス図情報100(変換前のクラス図情報100)が、予め記憶されているものとする。
FIG. 11 is a flowchart showing the flow of class diagram conversion processing executed by the class
まず、クラス図変換装置1のクラス図表示部111(図1参照)は、クラス図情報データベース41から、変換前のクラス図情報100を取得し(ステップS10)、表示装置2に表示させる。
First, the class diagram display unit 111 (see FIG. 1) of the class
そして、クラス図表示部111は、表示させたクラス図に基づき、設計者に変換対象の適用箇所を選択させる。そして、クラス図表示部111は、そのクラス図の適用箇所の選択情報を、入力装置3から入出力部20を介して受け付けたか否かを判定する(ステップS11)。ここで、クラス図表示部111は、適用箇所の選択情報を受け付けていない場合には(ステップS11→No)、適用箇所の選択情報が入力されるまで待つ。
この適用箇所の選択は、例えば、設計者が入力装置3により、画面に表示されたクラス図のうち、1つのクラスをクリック(マウス等による所定の操作)等することにより指定したり、複数のクラスの組合せをマウス等の所定の操作により同時に選択(範囲指定)したりすること等により、そのクラス図のうちの一部または全部の構成を、クラス図変換の適用箇所として選択する。
そして、クラス図表示部111は、適用箇所の選択情報を受け付けると(ステップS11→Yes)、その適用箇所の選択情報を、変換パターン表示部112(図1参照)に引き渡す。
Then, the class
The selection of the application location is specified, for example, by clicking one class (predetermined operation with a mouse or the like) in the class diagram displayed on the screen by the
When the class
変換パターン表示部112は、変換前のクラス図情報100のうち適用箇所の選択情報により指定される構成(以下、「適用箇所のクラス図情報」と呼ぶ。)に基づき、変換パターンデータベース42(図1参照)に格納されたパターン判定ロジックを参照し、その変換対象となる適用箇所が、クラスとその「関連」で示される所定のパターン(6種類のパターン)のうち、どのパターンに該当するかを特定する(ステップS12)。つまり、変換前のパターンがどのパターンに該当するかを特定する。
The conversion
ここで、ステップS12の変換前のパターンの特定処理について、設計者により、1つのクラスが変換対象の適用箇所として選択された場合と、複数のクラスの組合せが変換対象の適用箇所として選択(範囲指定)された場合とに分けて、詳細に説明する。
なお、1つのクラスが変換対象の適用箇所として設計者により選択された場合には、変換パターン表示部112は、その選択されたクラスを含む「関連」のパターンを表示させ(後記する、図13の「変換前パターン選択画面200」参照)、設計者に変換前のパターンを選択入力させることにより、変換前のパターンを特定する。一方、複数のクラスの組合せが変換対象の適用箇所として選択(範囲指定)された場合には、変換パターンデータベース42(図1参照)に格納されたパターン判定ロジックに基づき、変換パターン表示部112が、変換前のパターンを特定する。
Here, regarding the pattern specifying process before conversion in step S12, the designer selects one class as an application location to be converted, and selects a combination of a plurality of classes as an application location to be converted (range). It will be described in detail separately for the case where it is designated.
When one class is selected by the designer as an application location to be converted, the conversion
変換パターン表示部112は、1つのクラスが変換対象の適用箇所として選択された場合には、その選択されたクラスと直接的に接続された「関連」を有する他の構成要素(クラス、属性、オブジェクト)を抽出する。具体的には、変換パターン表示部112は、変換前のクラス図情報100のうち、選択されたクラスを含むレコードを抽出する。つまり、変換パターン表示部112は、その抽出したレコードの関連種別101および選択されたクラスが上位の構成要素または下位の構成要素のどちらであるか(以下、「『関連』の向き」と呼ぶことがある。)を判定する。
図12(a)は、ステップS11において、図12(b)に示すクラス図が画面表示されていた場合に、設計者により、1つのクラスとして「クラスA」が選択され、その「クラスA」と直接的に接続された「関連」を有する他の構成要素である、「属性X」,「クラスa」,「クラスb」,「クラスc」,「クラスB」が変換パターン表示部112により抽出され、その関連種別101および「関連」の向きが判定された場合の概念図である。つまり、図12(a)は、変換前のクラス図情報100に、クラスAが上位のクラスまたは下位のクラスのどちらかに存在するレコードとして、属性のレコードが1つ、集約のレコードが3つ、継承のレコードが1つ、の計5つの「関連」のレコードが存在することと、その「関連」の向きとを示している。
When one class is selected as an application location to be converted, the conversion
In FIG. 12A, when the class diagram shown in FIG. 12B is displayed on the screen in step S11, the designer selects “class A” as one class, and the “class A”. The conversion
次に、変換パターン表示部112は、抽出された他の構成要素(ここでは、「属性X」,「クラスa」,「クラスb」,「クラスc」,「クラスB」)それぞれのレコード毎に、その選択されたクラスを含む「関連」のパターンを、変換パターンデータベース42(図1参照)に格納されたパターン判定ロジックに基づき決定する。そして、変換パターン表示部112は、そのレコード毎に決定したパターンを、変換前パターン選択画面200(図13参照)として表示し、設計者に変換前のパターン、つまり、変換対象となるパターンを選択させる。
Next, the conversion
図13は、変換前パターン選択画面200の一例を示す図である。変換前パターン選択画面200には、変換前のクラス図情報100のうち、選択されたクラスと抽出された他の構成要素が格納されたレコード毎に、パターン判定ロジックに基づき決定されたパターンが表示される。例えば、図13に示すように、「クラスA」と「属性X」とが格納された属性のレコードについては、パターン[1]の「クラスと属性の関係」がそのレコードから決定されたパターンとして表示される(符号210)。「クラスA」と「クラスa」とが格納された集約のレコードについては、パターン[2]の「クラスの集約関係」がそのレコードから決定されたパターンとして表示される(符号220)。同様に、「クラスA」と「クラスb」とが格納された集約のレコードについては、パターン[2]の「クラスの集約関係」がそのレコードから決定されたパターンとして表示される(符号230)。「クラスA」と「クラスc」とが格納された集約のレコードについては、パターン[2]の「クラスの集約関係」がそのレコードから決定されたパターンとして表示される(符号240)。また、「クラスA」と「クラスB」とが格納された継承のレコードについては、パターン[6]の「継承関係」がそのレコードから決定されたパターンとして表示される(符号250)。
そして、変換パターン表示部112は、設計者により変換前パターン選択画面200の選択ボタン(符号201)が選択入力されることで、変換対象となるパターン(変換前のパターン)を特定する。
FIG. 13 is a diagram illustrating an example of the pre-conversion pattern selection screen 200. The pre-conversion pattern selection screen 200 displays a pattern determined based on the pattern determination logic for each record storing the selected class and other extracted components in the class diagram information 100 before conversion. Is done. For example, as shown in FIG. 13, with respect to an attribute record in which “class A” and “attribute X” are stored, the “relationship between class and attribute” of pattern [1] is a pattern determined from that record. Is displayed (reference numeral 210). For the aggregated record in which “class A” and “class a” are stored, the “class aggregation relationship” of pattern [2] is displayed as a pattern determined from the record (reference numeral 220). Similarly, for the aggregated record in which “class A” and “class b” are stored, the “class aggregation relationship” of pattern [2] is displayed as a pattern determined from the record (reference numeral 230). . For the aggregated record in which “class A” and “class c” are stored, the “class aggregation relationship” of pattern [2] is displayed as a pattern determined from the record (reference numeral 240). For the inheritance record in which “class A” and “class B” are stored, the “inheritance relationship” of pattern [6] is displayed as a pattern determined from the record (reference numeral 250).
And the conversion
また、変換パターン表示部112は、設計者により選択された適用箇所のクラス図情報が、複数のクラスの組合せを同時に選択(範囲指定)された情報であれば、変換パターンデータベース42(図1参照)に格納されたパターン判定ロジックのうち、各パターン(6つのパターン)それぞれに該当するか否かを、パターン[1]〜パターン[6]まで順に判定することにより、どのパターンに該当するのかを判定する。
Further, the conversion
図11に戻り、変換パターン表示部112は、ステップS12の結果、1つのクラスが変換対象の適用箇所として設計者により選択された場合において、表示された変換前パターン選択画面200(図13)でいずれのパターンも選択されなかった場合(不図示の終了ボタンが押された場合等)や、複数のクラスの組合せが変換対象の適用箇所として選択(範囲指定)された場合において、所定のパターン(6種類のパターン)のいずれにも該当しない場合には、処理を終了する(ステップS13→No)。一方、変換パターン表示部112は、いずれかのパターンが設計者により変換前のパターンとして特定された場合、または、複数のクラスの組合せが所定のパターン(6種類のパターン)のいずれかに該当した場合には(ステップS13→Yes)、次のステップS14に進む。
Returning to FIG. 11, when one class is selected as an application location to be converted by the designer as a result of step S <b> 12, the conversion
ステップS14において、変換パターン表示部112は、適用箇所のクラス図のパターンについて、変換可能な変換パターンを、変換パターンデータベース42(図1参照)に格納された変換パターン情報を参照して抽出し、変換パターン一覧画面300(図14,図15参照)を生成し、表示装置2に表示させる。
In step S14, the conversion
図14は、1つのクラスが変換対象の適用箇所として設計者により選択された場合における例として、図13の符号220に示す「クラスA」と「クラスa」とが格納された集約のレコードにおけるパターン[2]の「クラスの集約関係」が設計者により選択された場合の変換パターン一覧画面300(300a)を示している。
FIG. 14 shows an example of a case where one class is selected as an application location to be converted by the designer in an aggregated record storing “class A” and “class a” indicated by
図14に示すように、変換パターン一覧画面300(300a)は、適用箇所のパターン表示領域310と変換パターン表示領域320と備える。この適用箇所のパターン表示領域310には、ステップS12で特定した適用箇所のクラス図のパターン(変換前のパターン)を表示させる。また、変換パターン表示領域320には、その適用箇所のクラス図のパターンにおいて変換可能な変換パターンとして、変換後のクラス図のパターンが表示される。そして、設計者は、適用箇所のクラス図について変換させたいパターンを、その各変換パターンに設けられた選択ボタン(符号301(301a,301b,301c))を選択入力することにより決定する。
図14においては、変換パターン表示領域320に、適用箇所となるパターン[2]の「クラスの集約関係」に対して変換可能な変換パターンである、パターン[1]の「クラスと属性の関係」、パターン[3]の「クラスの集約関係+間に抽象クラス」、および、パターン[4]の「TMF SID Spec.Char.パターン」が表示され、設計者により選択される。
As illustrated in FIG. 14, the conversion pattern list screen 300 (300 a) includes a pattern display area 310 and a conversion pattern display area 320 of application locations. In the pattern display area 310 of the application location, the class diagram pattern (pattern before conversion) of the application location specified in step S12 is displayed. In the conversion pattern display area 320, the converted class diagram pattern is displayed as a conversion pattern that can be converted in the class diagram pattern at the application location. Then, the designer determines a pattern to be converted for the class diagram of the application location by selecting and inputting a selection button (reference numeral 301 (301a, 301b, 301c)) provided for each conversion pattern.
In FIG. 14, “Relationship between class and attribute” of Pattern [1], which is a conversion pattern that can be converted to “Class Aggregation Relationship” of Pattern [2] as an application location in the conversion pattern display area 320. Pattern [3] “Class aggregation relationship + abstract class between” and Pattern [4] “TMF SID Spec.Char. Pattern” are displayed and selected by the designer.
また、図15は、複数のクラスの組合せが変換対象の適用箇所として選択(範囲指定)された場合において、変換パターン表示部112により、適用箇所のクラス図のパターンが「[2]クラスの集約関係」と判定された場合の変換パターン一覧画面300(300b)を示している。
Also, FIG. 15 shows that when a combination of a plurality of classes is selected (range designation) as an application location to be converted, the conversion
図14に示す変換パターン一覧画面300(300a)と同様に、図15に示す変換パターン一覧画面300(300b)においては、適用箇所のパターン表示領域310に、ステップS12で判定した適用箇所のクラス図のパターン(複数の構成要素を含む変換前のパターン)が表示させる。また、変換パターン表示領域320には、その適用箇所のクラス図のパターンにおいて変換可能な変換パターンとして、変換後のクラス図のパターン(複数の構成要素により構成されるパターン)が表示される。そして、設計者は、適用箇所のクラス図について変換させたいパターンを、その各変換パターンに設けられた選択ボタン(符号303(303a,303b,303c))を選択入力することにより決定する。 As with the conversion pattern list screen 300 (300a) shown in FIG. 14, in the conversion pattern list screen 300 (300b) shown in FIG. 15, the class diagram of the application location determined in step S12 is displayed in the pattern display area 310 of the application location. Pattern (a pattern before conversion including a plurality of components) is displayed. Also, in the conversion pattern display area 320, a converted class diagram pattern (a pattern composed of a plurality of components) is displayed as a conversion pattern that can be converted in the class diagram pattern of the application location. Then, the designer determines a pattern to be converted for the class diagram of the application location by selecting and inputting a selection button (reference numeral 303 (303a, 303b, 303c)) provided for each conversion pattern.
図11に戻り、ステップS15において、変換パターン表示部112は、表示装置2に表示された変換パターン一覧画面300において、設計者により変換パターンが選択されることにより、入出力部20を介して、変換パターンの選択情報を受け付けたか否かを判定する。ここで、変換パターン表示部112は、変換パターンの選択情報を受け付けていない場合には(ステップS15→No)、受け付けるまで待つ。一方、変換パターン表示部112は、変換パターンの選択情報を受け付けた場合には(ステップS15→Yes)、その変換パターンの選択情報をクラス図変換処理部113に引き渡し、次のステップS16に進む。
Returning to FIG. 11, in step S <b> 15, the conversion
ステップS16において、クラス図変換処理部113は、ステップS15で受け付けた変換パターンの選択情報に基づき、適用箇所のクラス図を変換する。そして、クラス図変換処理部113は、変換後のクラス図を表示装置2に表示させる。なお、このクラス図変換処理部113による、各変換パターンに基づく変換処理の詳細については、後記する。
In step S16, the class diagram
このようにすることで、本実施形態に係るクラス図変換装置1によれば、設計者が選択した適用箇所のクラス図のパターンにおいて、変換可能な変換パターンを提示し、設計者が選択した変換パターンにより、適用箇所のクラス図を変換することができる。
By doing in this way, according to the class
(クラス図の変換処理)
次に、本実施形態に係るクラス図変換装置1のクラス図変換処理部113による、クラス図の変換処理について説明する。
クラス図変換処理部113は、前記した(第1変換パターン)〜(第10変換パターン)に基づき、クラス図の変換処理を実行する。以下、クラス図変換処理部113が、各変換パターンの変換処理を実行する際に行う、クラス図情報100のデータの変換処理について具体的に説明する。
(Class diagram conversion process)
Next, class diagram conversion processing by the class diagram
The class diagram
≪第1変換パターン:パターン[1]→[2]≫
図16は、本実施形態に係るクラス図変換装置1が第1変換パターン([1]クラスと属性の関係→[2]クラスの集約関係)を実行する際のクラス図情報100の変換処理を説明するための図である。
図16は、変換前のクラス図情報(符号1010)と、クラス図の変換処理による変換後のクラス図情報(符号2010)とを示している。クラス図変換処理部113は、第1変換パターンの場合、図16に示すように、関連種別101を「属性」から「集約」に書き換え、To要素種別105を「属性」から「クラス」に書き換える。
このようなデータ処理を実行することにより、クラス図変換処理部113は、パターン[1]→[2]へのクラス図情報100の変換を行う。
<< First conversion pattern: Pattern [1] → [2] >>
FIG. 16 shows the conversion process of the class diagram information 100 when the class
FIG. 16 shows class diagram information (reference numeral 1010) before conversion and class diagram information (reference numeral 2010) after conversion by the class diagram conversion processing. In the case of the first conversion pattern, the class diagram
By executing such data processing, the class diagram
なお、図16においては、変換前のクラス図情報(符号1010)として、図3のクラス図情報100(100a)の1行目のみを示し、属性「b」,「c」についての記載を省略している。また、変換後のクラス情報(符号2010)についても、クラス「b」,「c」についての記載を省略している。以下、図17〜図25も同様に、ID(From要素ID104またはTo要素ID106)のみ異なる構成要素については、変換前と変換後のクラス図情報100において、その記載を省略している。
In FIG. 16, only the first line of the class diagram information 100 (100a) in FIG. 3 is shown as the class diagram information (reference numeral 1010) before conversion, and descriptions of the attributes “b” and “c” are omitted. doing. In addition, with regard to the class information after conversion (reference numeral 2010), the descriptions of the classes “b” and “c” are omitted. Hereinafter, in FIG. 17 to FIG. 25 as well, the description of the constituent elements that differ only in the ID (From
≪第2変換パターン:パターン[2]→[1]≫
図17は、本実施形態に係るクラス図変換装置1が第2変換パターン([2]クラスの集約関係→[1]クラスと属性の関係)を実行する際のクラス図情報100の変換処理を説明するための図である。
図17は、変換前のクラス図情報(符号1020)と、クラス図の変換処理による変換後のクラス図情報(符号2020)とを示している。クラス図変換処理部113は、第2変換パターンの場合、図17に示すように、関連種別101を「集約」から「属性」に書き換え、To要素種別105を「クラス」から「属性」に書き換える。
このようなデータ処理を実行することにより、クラス図変換処理部113は、パターン[2]→[1]へのクラス図情報100の変換を行う。
<< Second conversion pattern: Pattern [2] → [1] >>
FIG. 17 shows the conversion process of the class diagram information 100 when the class
FIG. 17 shows class diagram information (reference numeral 1020) before conversion and class diagram information (reference numeral 2020) after conversion by the class diagram conversion processing. In the case of the second conversion pattern, the class diagram
By executing such data processing, the class diagram
≪第3変換パターン:パターン[2]→[3]≫
図18は、本実施形態に係るクラス図変換装置1が第3変換パターン([2]クラスの集約関係→[3]クラスの集約関係+間に抽象クラス)を実行する際のクラス図情報100の変換処理を説明するための図である。
図18は、変換前のクラス図情報(符号1030)と、クラス図の変換処理による変換後のクラス図情報(符号2030)とを示している。クラス図変換処理部113は、第3変換パターンの場合、図18に示すように、関連種別101が「集約」のTo要素種別105およびTo要素ID106について、抽象クラス(クラスR)を新規に挿入する。そして、クラス図変換処理部113は、新たにレコードを追加して、関連種別101に「継承」を設定し、From要素種別103およびFrom要素ID104に新規に挿入した抽象クラス(クラスR)を設定し、そのTo要素種別105およびTo要素ID106に、変換前のTo要素種別105の「クラス」と変換前のTo要素ID106の「a」とを移行する。
このようなデータ処理を実行することにより、クラス図変換処理部113は、パターン[2]→[3]へのクラス図情報100の変換を行う。
<< Third conversion pattern: Pattern [2] → [3] >>
FIG. 18 shows class diagram information 100 when the class
FIG. 18 shows class diagram information (reference numeral 1030) before conversion and class diagram information (reference numeral 2030) after conversion by the class diagram conversion processing. In the case of the third conversion pattern, the class diagram
By executing such data processing, the class diagram
≪第4変換パターン:パターン[3]→[2]≫
図19は、本実施形態に係るクラス図変換装置1が第4変換パターン([3]クラスの集約関係+間に抽象クラス→[2]クラスの集約関係)を実行する際のクラス図情報100の変換処理を説明するための図である。
図19は、変換前のクラス図情報(符号1040)と、クラス図の変換処理による変換後のクラス図情報(符号2040)とを示している。クラス図変換処理部113は、第4変換パターンの場合、図19に示すように、変換前のクラス情報(符号1040)から「継承」のレコードを削除し、変換前の「継承」のレコードのTo要素種別105の「クラス」およびTo要素ID106の「a」を、変換後の「集約」のレコードのTo要素種別105およびTo要素ID106に移行する。
このようなデータ処理を実行することにより、クラス図変換処理部113は、パターン[3]→[2]へのクラス図情報100の変換を行う。
<< 4th conversion pattern: Pattern [3] → [2] >>
FIG. 19 shows class diagram information 100 when the class
FIG. 19 shows class diagram information (reference numeral 1040) before conversion and class diagram information (reference numeral 2040) after conversion by the class diagram conversion processing. In the case of the fourth conversion pattern, the class diagram
By executing such data processing, the class diagram
≪第5変換パターン:パターン[3]→[4]≫
図20は、本実施形態に係るクラス図変換装置1が第5変換パターン([3]クラスの集約関係+間に抽象クラス→[4]TMF SID Spec.Char.パターン)を実行する際のクラス図情報100の変換処理を説明するための図である。
図20は、変換前のクラス図情報(符号1050)と、クラス図の変換処理による変換後のクラス図情報(符号2050)とを示している。クラス図変換処理部113は、第5変換パターンの場合、図20に示すように、変換前の「集約」のレコードのFrom要素種別103およびFrom要素ID104で示される「クラスA」を、変換後に新たに追加した「インスタンス」のレコードのTo要素種別105およびTo要素ID106で示される「オブジェクトA」としてインスタンス化する。また、クラス図変換処理部113は、変換前の「継承」のレコードのTo要素種別105およびTo要素ID106で示される「クラスa」を、変換後に新たに追加した「インスタンス」のレコードのTo要素種別105およびTo要素ID106で示される「オブジェクトa」としてインスタンス化する。
クラス図変換処理部113は、変換前の「集約」のレコードのFrom要素種別103およびFrom要素ID104で示される「クラスA」、および、To要素種別105およびTo要素ID106で示される「クラスR」それぞれを、変換後に各オブジェクトを収容する新規なクラス(「クラスSA」「クラスSAC」)に書き換える。そして、クラス図変換処理部113は、変換前の「継承」のレコードを削除する。
このようなデータ処理を実行することにより、クラス図変換処理部113は、パターン[3]→[4]へのクラス図情報100の変換を行う。
<< Fifth Conversion Pattern: Pattern [3] → [4] >>
20 shows a class when the class
FIG. 20 shows class diagram information (reference numeral 1050) before conversion and class diagram information (reference numeral 2050) after conversion by the class diagram conversion processing. In the case of the fifth conversion pattern, the class diagram
The class diagram
By executing such data processing, the class diagram
≪第6変換パターン:パターン[4]→[3]≫
図21は、本実施形態に係るクラス図変換装置1が第6変換パターン([4]TMF SID Spec.Char.パターン→[3]クラスの集約関係+間に抽象クラス)を実行する際のクラス図情報100の変換処理を説明するための図である。
図21は、変換前のクラス図情報(符号1060)と、クラス図の変換処理による変換後のクラス図情報(符号2060)とを示している。クラス図変換処理部113は、第6変換パターンの場合、図21に示すように、変換前の「集約」のFrom要素種別103およびFrom要素ID104で示されるクラスである「クラスSA」のオブジェクトであり、「インスタンス」のレコードのTo要素種別105およびTo要素ID106で示される「オブジェクトA」を、変換後の「集約」のレコードのFrom要素種別103およびFrom要素ID104で示される「クラスA」として脱インスタンス化する。また、クラス図変換処理部113は、変換前の「集約」のTo要素種別105およびTo要素ID106で示されるクラスである「クラスSAC」のオブジェクトであり、「インスタンス」のレコードのTo要素種別105およびTo要素ID106で示される「オブジェクトa」を、変換後の新たに追加した「継承」のレコードのTo要素種別105およびTo要素ID106で示される「クラスa」として脱インスタンス化する。
また、クラス図変換処理部113は、変換後の「クラスa」が継承する新規のクラス(クラスR)を設定し、変換後の「集約」のレコードのTo要素種別105およびTo要素ID106に格納し、さらに、変換後の「継承」のレコードのFrom要素種別103およびFrom要素ID104に格納する。
このようなデータ処理を実行することにより、クラス図変換処理部113は、パターン[4]→[3]へのクラス図情報100の変換を行う。
<< Sixth Conversion Pattern: Pattern [4] → [3] >>
FIG. 21 shows a class when the class
FIG. 21 shows class diagram information (reference numeral 1060) before conversion and class diagram information (reference numeral 2060) after conversion by the class diagram conversion processing. In the case of the sixth conversion pattern, the class diagram
Also, the class diagram
By executing such data processing, the class diagram
≪第7変換パターン:パターン[2]→[4]≫
図22は、本実施形態に係るクラス図変換装置1が第7変換パターン([2]クラスの集約関係→[4]TMF SID Spec.Char.パターン)を実行する際のクラス図情報100の変換処理を説明するための図である。
図22は、変換前のクラス図情報(符号1070)と、クラス図の変換処理による変換後のクラス図情報(符号2070)とを示している。クラス図変換処理部113は、第7変換パターンの場合、図22に示すように、変換前の「集約」のレコードのFrom要素種別103およびFrom要素ID104で示される「クラスA」を、変換後に新たに追加した「インスタンス」のレコードのTo要素種別105およびTo要素ID106で示される「オブジェクトA」としてインスタンス化する。また、クラス図変換処理部113は、変換前の「集約」のTo要素種別105およびTo要素ID106で示される「クラスa」を、変換後に新たに追加した「インスタンス」のレコードのTo要素種別105およびTo要素ID106で示される「オブジェクトa」としてインスタンス化する。
クラス図変換処理部113は、変換後の「オブジェクトA」を収容する新規なクラス(「クラスSA」)と、変換後の「オブジェクトa」を収容する新規なクラス(「クラスSAC」)とを設定する。そして、クラス図変換処理部113は、クラスSAがクラスSACを集約するレコードを生成する。
このようなデータ処理を実行することにより、クラス図変換処理部113は、パターン[2]→[4]へのクラス図情報100の変換を行う。
<< Seventh conversion pattern: Pattern [2] → [4] >>
FIG. 22 shows the conversion of the class diagram information 100 when the class
FIG. 22 shows class diagram information (reference numeral 1070) before conversion and class diagram information (reference numeral 2070) after conversion by the class diagram conversion processing. In the case of the seventh conversion pattern, the class diagram
The class diagram
By executing such data processing, the class diagram
≪第8変換パターン:パターン[4]→[2]≫
図23は、本実施形態に係るクラス図変換装置1が第8変換パターン([4]TMF SID Spec.Char.パターン→[2]クラスの集約関係)を実行する際のクラス図情報100の変換処理を説明するための図である。
図23は、変換前のクラス図情報(符号1080)と、クラス図の変換処理による変換後のクラス図情報(符号2080)とを示している。クラス図変換処理部113は、第8変換パターンの場合、図23に示すように、変換前の「集約」のFrom要素種別103およびFrom要素ID104で示されるクラスである「クラスSA」のオブジェクトであり、「インスタンス」のレコードのTo要素種別105およびTo要素ID106で示される「オブジェクトA」を、変換後の「集約」のレコードのFrom要素種別103およびFrom要素ID104で示される「クラスA」として脱インスタンス化する。また、クラス図変換処理部113は、変換前の「集約」のTo要素種別105およびTo要素ID106で示されるクラスである「クラスSAC」のオブジェクトであり、「インスタンス」のレコードのTo要素種別105およびTo要素ID106で示される「オブジェクトa」を、変換後の「集約」のレコードのTo要素種別105およびTo要素ID106で示される「クラスa」として脱インスタンス化する。
このようなデータ処理を実行することにより、クラス図変換処理部113は、パターン[4]→[2]へのクラス図情報100の変換を行う。
<< Eighth conversion pattern: Pattern [4] → [2] >>
FIG. 23 shows the conversion of the class diagram information 100 when the class
FIG. 23 shows class diagram information (reference numeral 1080) before conversion and class diagram information (reference numeral 2080) after conversion by the class diagram conversion processing. In the case of the eighth conversion pattern, the class diagram
By executing such data processing, the class diagram
≪第9変換パターン:パターン[5]→[6]≫
図24は、本実施形態に係るクラス図変換装置1が第9変換パターン([5]委譲による継承関係の実現→[6]継承関係)を実行する際のクラス図情報100の変換処理を説明するための図である。
図24は、変換前のクラス図情報(符号1090)と、クラス図の変換処理による変換後のクラス図情報(符号2090)とを示している。クラス図変換処理部113は、第9変換パターンの場合、図24に示すように、変換前の「集約」のレコードのFrom要素ID104の値「B」を、変換後に新たに設定した「継承」のレコードのTo要素ID106に設定する。また、クラス図変換処理部113は、変換前の「集約」のレコードのTo要素ID106の値「A」を、変換後の新たに設定した「継承」のレコードのFrom要素ID104に設定する。そして、クラス図変換処理部113は、変換前の「集約」のレコードを削除する。
このようなデータ処理を実行することにより、クラス図変換処理部113は、パターン[5]→[6]へのクラス図情報100の変換を行う。
<< 9th conversion pattern: Pattern [5] → [6] >>
FIG. 24 illustrates the conversion process of the class diagram information 100 when the class
FIG. 24 shows class diagram information (reference numeral 1090) before conversion and class diagram information (reference numeral 2090) after conversion by the class diagram conversion processing. In the case of the ninth conversion pattern, the class diagram
By executing such data processing, the class diagram
≪第10変換パターン:パターン[6]→[5]≫
図25は、本実施形態に係るクラス図変換装置1が第10変換パターン([6]継承関係→[5]委譲による継承関係の実現)を実行する際のクラス図情報100の変換処理を説明するための図である。
図25は、変換前のクラス図情報(符号1100)と、クラス図の変換処理による変換後のクラス図情報(符号2100)とを示している。クラス図変換処理部113は、第10変換パターンの場合、図25に示すように、変換前の「継承」のレコードのFrom要素ID104の値「A」を、変換後に新たに設定した「集約」のレコードのTo要素ID106に設定する。また、クラス図変換処理部113は、変換前の「継承」のレコードのTo要素ID106の値「B」を、変換後の新たに設定した「集約」のレコードのFrom要素ID104に設定する。そして、クラス図変換処理部113は、変換後の新たに設定した「集約」のレコードの表示関連情報109に、クラスBから委譲先であるクラスAに向けての矢印(→)の情報を格納する。続いて、クラス図変換処理部113は、変換前の「継承」のレコードを削除する。
このようなデータ処理を実行することにより、クラス図変換処理部113は、パターン[6]→[5]へのクラス図情報100の変換を行う。
<< 10th conversion pattern: Pattern [6] → [5] >>
FIG. 25 illustrates the conversion process of the class diagram information 100 when the class
FIG. 25 illustrates class diagram information (reference numeral 1100) before conversion and class diagram information (reference numeral 2100) after conversion by the class diagram conversion processing. In the case of the tenth conversion pattern, the class diagram
By executing such data processing, the class diagram
以上説明したように、本実施形態に係るクラス図変換装置1およびクラス図変換プログラムによれば、既存のデザインパターンに限定されず、設計者が選択に迷いそうなパターンについて、その変換パターンを表示して設計者に選択させることができる。よって、設計者は変更が必要なパターンついての高度な知識を必要とせず、一旦作成したクラス図を見直して、最適なクラス図のパターンに変換することが可能となる。
As described above, according to the class
1 クラス図変換装置
2 表示装置
3 入力装置
10 制御部
11 表示処理部(表示処理手段)
12 入出力情報処理部
20 入出力部(入力手段)
30 メモリ部
40 記憶部(記憶手段)
41 クラス図情報データベース
42 変換パターンデータベース
100 クラス図情報
111 クラス図表示部
112 変換パターン表示部
113 クラス図変換処理部
200 変換前パターン選択画面
300 変換パターン一覧画面
1 class
12 Input / output
30 memory section 40 storage section (storage means)
41 Class
Claims (8)
前記クラス図を構成する、前記クラス、前記クラスの属性および前記クラスの実例を示すオブジェクトを、前記クラス図を変換する際の対等な構成要素とし、
前記クラス図内の2つの構成要素毎に、前記構成要素間の関連の種別と、前記クラス、前記属性、前記オブジェクトのいずれかを示す前記構成要素の種別とを用いて、変換前の前記クラス図の構成のパターンを示すクラス図情報、前記クラス図を構成するパターンが、所定のパターン群のうちのどのパターンに該当するかを前記クラス図情報を参照して特定するためのパターン判定ロジック、および、変換前のパターンと当該変換前のパターンにおいて変換可能な変換後のパターンとの組合せを示す変換パターンが複数格納される変換パターン情報を記憶する記憶手段と、
前記変換前のクラス図情報を取得して前記変換前のクラス図を前記表示装置に表示させ、前記変換前のクラス図の前記クラス、前記属性および前記オブジェクトのうち少なくともいずれか1つが選択された変換対象となる適用箇所を、入力手段を介して取得し、
取得した前記適用箇所に示される前記変換前のクラス図のパターンを、前記クラス図情報を参照して前記パターン判定ロジックに基づき特定し、前記特定したパターンについて変換可能な前記変換パターンを、前記変換パターン情報を参照して決定し、
決定した前記変換可能な変換パターンに示される、前記変換前のパターンと当該変換前のパターンにおいて変換可能な1つ以上の変換後のパターンとを前記表示装置に表示させ、前記1つ以上の変換後のパターンのうちから選択された変換後のパターンの選択情報を、前記入力手段を介して取得し、
前記適用箇所に示される前記変換前のクラス図のパターンを、取得した前記変換後のパターンに変換し、前記表示装置に表示させる表示処理手段と、
を備えることを特徴とするクラス図変換装置。 In the class diagram used in object-oriented software development, the pattern of the structure indicated by the combination of the classes and the relations representing the connection relationship between the classes is converted into another pattern different from the current pattern and displayed on the display device. A class diagram conversion device for causing
The class, the class attribute, and the object indicating the instance of the class are configured as equivalent components when converting the class diagram.
For each of the two components in the class diagram, the class before conversion using the type of association between the components and the type of the component indicating any one of the class, the attribute, and the object Class diagram information indicating a pattern of the configuration of the figure, pattern determination logic for specifying which pattern of the predetermined pattern group corresponds to the pattern constituting the class diagram with reference to the class diagram information , and, storage means for storing the conversion pattern information conversion pattern indicating a combination of the pattern after convertible conversion in the pre-conversion pattern and the pre-conversion of the pattern is more stored,
The class diagram information before the conversion is acquired and the class diagram before the conversion is displayed on the display device, and at least one of the class, the attribute, and the object of the class diagram before the conversion is selected. Obtain the application location to be converted via the input means,
The pattern of the class diagram before conversion indicated in the acquired application location is specified based on the pattern determination logic with reference to the class diagram information, and the conversion pattern that can be converted for the specified pattern is converted to the conversion Determine by referring to the pattern information,
The display device displays the pre-conversion pattern and one or more post-conversion patterns that can be converted in the pre-conversion pattern indicated by the determined conversion pattern that can be converted, and the one or more conversions The selection information of the converted pattern selected from the later patterns is acquired via the input means,
Display processing means for converting the pattern of the class diagram before conversion shown in the application location into the acquired pattern after conversion and displaying the pattern on the display device;
A class diagram conversion device comprising:
前記クラスと属性の関係を示すパターンを、前記クラスの集約関係を示すパターンに変換する変換パターンを含むことIncluding a conversion pattern for converting a pattern indicating the relationship between the class and the attribute into a pattern indicating an aggregate relationship of the class.
を特徴とする請求項2に記載のクラス図変換装置。The class diagram conversion device according to claim 2.
前記クラスの集約関係を示すパターンを、前記クラスと属性の関係を示すパターン、前記クラスの集約関係において間に抽象クラスを有するパターン、前記クラスの集約関係において当該クラスがオブジェクトを備えるパターン、のそれぞれに変換する変換パターンを含むことA pattern indicating an aggregation relationship of the class, a pattern indicating a relationship between the class and an attribute, a pattern having an abstract class in the aggregation relationship of the class, and a pattern in which the class includes an object in the aggregation relationship of the class Include a conversion pattern to convert to
を特徴とする請求項2に記載のクラス図変換装置。The class diagram conversion device according to claim 2.
前記クラスの集約関係において間に抽象クラスを有するパターンを、前記クラスの集約関係を示すパターン、前記クラスの集約関係において当該クラスがオブジェクトを備えるパターン、のそれぞれに変換する変換パターンを含むことIncluding a conversion pattern for converting a pattern having an abstract class in the aggregation relation of the class into a pattern indicating the aggregation relation of the class and a pattern in which the class includes an object in the aggregation relation of the class.
を特徴とする請求項2に記載のクラス図変換装置。The class diagram conversion device according to claim 2.
前記クラスの集約関係において当該クラスがオブジェクトを備えるパターンを、前記クラスの集約関係を示すパターン、前記クラスの集約関係において間に抽象クラスを有するパターン、のそれぞれに変換する変換パターンを含むことIncluding a conversion pattern for converting a pattern including the object in the class aggregation relationship into a pattern indicating the class aggregation relationship and a pattern having an abstract class in the class aggregation relationship.
を特徴とする請求項2に記載のクラス図変換装置。The class diagram conversion device according to claim 2.
前記委譲により継承関係を実現するパターンと、前記継承関係を示すパターンとを相互に変換する変換パターンを含むことIncluding a conversion pattern for mutually converting a pattern realizing the inheritance relationship by the delegation and a pattern indicating the inheritance relationship
を特徴とする請求項2に記載のクラス図変換装置。The class diagram conversion device according to claim 2.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2012242918A JP5952716B2 (en) | 2012-11-02 | 2012-11-02 | Class diagram conversion device and class diagram conversion program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2012242918A JP5952716B2 (en) | 2012-11-02 | 2012-11-02 | Class diagram conversion device and class diagram conversion program |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2014092920A JP2014092920A (en) | 2014-05-19 |
JP5952716B2 true JP5952716B2 (en) | 2016-07-13 |
Family
ID=50936954
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2012242918A Expired - Fee Related JP5952716B2 (en) | 2012-11-02 | 2012-11-02 | Class diagram conversion device and class diagram conversion program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP5952716B2 (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112912839A (en) | 2018-11-01 | 2021-06-04 | 日立安斯泰莫株式会社 | Software management device |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP3447365B2 (en) * | 1993-04-14 | 2003-09-16 | 株式会社東芝 | Object-oriented programming support device and object-oriented programming support method |
JPH10254686A (en) * | 1997-03-07 | 1998-09-25 | Mitsubishi Electric Corp | Object oriented programming supporting device |
JP2005173788A (en) * | 2003-12-09 | 2005-06-30 | Ibm Japan Ltd | Autonomic computing system, execution environment control method, and program |
-
2012
- 2012-11-02 JP JP2012242918A patent/JP5952716B2/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
JP2014092920A (en) | 2014-05-19 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Bruneliere et al. | Modisco: A model driven reverse engineering framework | |
Escobar et al. | Towards the understanding and evolution of monolithic applications as microservices | |
US9621428B1 (en) | Multi-tiered cloud application topology modeling tool | |
US8401687B2 (en) | Visual assembly tool | |
US8810595B2 (en) | Declarative approach for visualization | |
US9395889B1 (en) | Identification of semantically relevant concepts in a graphical model | |
US8707261B2 (en) | Service integration modeling and execution framework | |
US8776009B2 (en) | Method and system for task modeling of mobile phone applications | |
JP2021012740A (en) | Compound control | |
US20120041990A1 (en) | System and Method for Generating Dashboard Display in Software Applications | |
CN107533453A (en) | System and method for generating data visualization application | |
US9367289B2 (en) | Method and apparatus for enabling agile development of services in cloud computing and traditional environments | |
US9177082B2 (en) | Drawing automation in computer aided design systems | |
Ahmaro et al. | Taxonomy, definition, approaches, benefits, reusability levels, factors and adaption of software reusability: a review of the research literature | |
US20120060141A1 (en) | Integrated environment for software design and implementation | |
Eickhoff et al. | A metadata repository for semantic product lifecycle management | |
Dukaric et al. | BPMN extensions for automating cloud environments using a two-layer orchestration approach | |
US20110289515A1 (en) | Generating service-access activities for workflow applications | |
Nilsson et al. | Model-based user interface adaptation | |
JP5952716B2 (en) | Class diagram conversion device and class diagram conversion program | |
CN115495069B (en) | Model-driven coal industry software process implementation method, device and equipment | |
CN103971225A (en) | Workflow dynamic expanding method and system | |
Tran et al. | Systematic generation of abstract user interfaces | |
US11675571B1 (en) | Restructuring enterprise application | |
Rani et al. | Exploring and extending research in multi-vendor software ecosystem |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
RD02 | Notification of acceptance of power of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7422 Effective date: 20140502 |
|
RD04 | Notification of resignation of power of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7424 Effective date: 20140528 |
|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20150115 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20150928 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20151027 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20151218 |
|
TRDD | Decision of grant or rejection written | ||
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20160607 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20160610 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 5952716 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
LAPS | Cancellation because of no payment of annual fees |