JPH11353168A - Interface matching method and recording medium where interface matching program is recorded - Google Patents

Interface matching method and recording medium where interface matching program is recorded

Info

Publication number
JPH11353168A
JPH11353168A JP10161600A JP16160098A JPH11353168A JP H11353168 A JPH11353168 A JP H11353168A JP 10161600 A JP10161600 A JP 10161600A JP 16160098 A JP16160098 A JP 16160098A JP H11353168 A JPH11353168 A JP H11353168A
Authority
JP
Japan
Prior art keywords
interface
client
component
arguments
methods
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.)
Pending
Application number
JP10161600A
Other languages
Japanese (ja)
Inventor
Hitoshi Hiwatari
仁 樋渡
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.)
Nippon Telegraph and Telephone Corp
Original Assignee
Nippon Telegraph and Telephone 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 Nippon Telegraph and Telephone Corp filed Critical Nippon Telegraph and Telephone Corp
Priority to JP10161600A priority Critical patent/JPH11353168A/en
Publication of JPH11353168A publication Critical patent/JPH11353168A/en
Pending legal-status Critical Current

Links

Landscapes

  • Stored Programmes (AREA)

Abstract

PROBLEM TO BE SOLVED: To lighten the burden on an application programmer by automatically generating a code for putting together components to be reused. SOLUTION: If a component to be reused on a client side is different from an interface that the client side requires and can not be reused (a), a glue code generating device 1 mounts the client-side interface and automatically generate a code for putting together the components to be reused (b). Namely, differences due to methods and the order of arguments are absorbed from the interface descriptions of the client side and component side to extract the correspondence relation between the methods and arguments. When plural correspondence relations are present and not clear, the user is allowed to make a choice among candidates. The correspondence relation is used to define a new component mounted with the client-side interface and a programming code for putting together the components to be reused is automatically generated therein.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は,ソフトウェアコン
ポーネントの再利用に係わり,特にコンポーネント側イ
ンタフェースとクライアント側インタフェースとが異な
る場合に,両者を仲介するコードを自動生成できるとい
う改善を図ったインタフェースマッチング方法およびイ
ンタフェースマッチングプログラムを記録した記録媒体
に関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to the reuse of software components, and more particularly to an interface matching method which can automatically generate a code mediating between a component side interface and a client side interface when the interface is different. And a recording medium on which an interface matching program is recorded.

【0002】[0002]

【従来の技術】図7ないし図9を用いて従来技術を説明
する。ソフトウェアコンポーネントを再利用する場合,
コンポーネント側とクライアント側インタフェースは一
致することが必須条件である。従来,コンポーネント側
としては図7に示すようなインタフェースしか実装され
ていないという状況で,クライアント側が図8に示すよ
うなインタフェースの利用を要請した場合に,インタフ
ェース間の仕様に不一致があるため,単純な形ではコン
ポーネントの再利用はできないという課題があった。
2. Description of the Related Art The prior art will be described with reference to FIGS. When reusing software components,
It is essential that the component side and the client side interface match. Conventionally, in the situation where only the interface as shown in FIG. 7 is implemented as the component side, if the client side requests the use of the interface as shown in FIG. 8, there is a mismatch in the specifications between the interfaces. There was a problem that components could not be reused in an unusual form.

【0003】上記の課題を解決する方法として,コンポ
ーネント指向プログラミングでは,図9に示すように,
クライアント側インタフェースを実装するコンポーネン
トを新たに定義して,メソッドおよび引数の対応関係を
考慮しながら,再利用するコンポーネントを集約(aggre
gate) するコードを手書きしてきた。
As a method for solving the above problem, in component-oriented programming, as shown in FIG.
A component that implements the client-side interface is newly defined, and the components to be reused are aggregated (aggre
gate) handwritten code.

【0004】[0004]

【発明が解決しようとする課題】しかし,クライアント
側インタフェースを実装するコンポーネントを新たに定
義して,メソッドおよび引数の対応関係を考慮しなが
ら,再利用するコンポーネントを集約するコードを手書
きすることは,アプリケーションプログラマには自明で
ある一方,煩雑であるという課題があった。
However, it is not possible to newly define a component that implements a client-side interface and hand-write a code for aggregating components to be reused while considering the correspondence between methods and arguments. While it was obvious to application programmers, there was a problem that it was complicated.

【0005】本発明は,上述したような従来技術の有す
る欠点に鑑みてなされたもので,再利用するコンポーネ
ントを集約するコードを自動生成する手段を提供するこ
とにより,アプリケーションプログラマの負担を軽減す
ることを目的とする。
The present invention has been made in view of the above-mentioned drawbacks of the related art, and reduces the burden on an application programmer by providing a means for automatically generating a code for aggregating components to be reused. The purpose is to:

【0006】[0006]

【課題を解決するための手段】本発明は,図1(a)に
示すように,クライアント(Cclient )側で再利用する
コンポーネント(Ccomponent1, Ccomponent2)が,クラ
イアント側が必要とするインタフェースと異なっている
と再利用できないという課題を解決するために,図1
(b)に示すように,グルーコード作成装置1により,
クライアント側インタフェースを実装して再利用するコ
ンポーネントを集約するコードを自動生成することによ
って,インタフェースのマッチングをとり,再利用可能
とする。
According to the present invention, as shown in FIG. 1A, components (Ccomponent1 and Ccomponent2) to be reused on a client (Cclient) side are different from interfaces required by the client side. Fig. 1
As shown in (b), the glue code creating device 1
By automatically generating code that implements the client-side interface and aggregates the components to be reused, it matches the interfaces and makes them reusable.

【0007】本発明では,具体的には次のような方法を
用いる。 (1) クライアント側とコンポーネント側インタフェース
記述を入力し,各インタフェースに含まれるメソッドお
よび各メソッドに含まれる引数を抽出する(図2参
照)。
In the present invention, specifically, the following method is used. (1) The client-side and component-side interface descriptions are input, and the methods included in each interface and the arguments included in each method are extracted (see FIG. 2).

【0008】(2) コンポーネント側インタフェースが複
数の場合には,コンポーネント側インタフェースに含ま
れるメソッドは,コンポーネント側メソッドとして一括
して認識する(図2参照)。
(2) When there are a plurality of component side interfaces, the methods included in the component side interface are collectively recognized as component side methods (see FIG. 2).

【0009】(3) インタフェース側メソッドが,コンポ
ーネント側ではどのメソッドに対応しているかを抽出す
る。双方のメソッドにおいて,引数数・返値型・全ての
引数型が一致している場合,対応すると定義する(図3
参照)。
(3) On the component side, the method corresponding to the interface side method is extracted. If the number of arguments, return type, and all argument types match in both methods, it is defined as corresponding (Fig. 3
reference).

【0010】(4) 全部の組み合わせを調べて,クライア
ント側メソッドが複数のコンポーネント側メソッドに対
応する場合には,利用者に選択させる(図3参照)。 (5) クライアント側およびコンポーネント側の対応する
各メソッドにおいて,引数の対応関係を抽出する(図4
参照)。
(4) All combinations are checked, and when the client side method corresponds to a plurality of component side methods, the user is made to select (see FIG. 3). (5) For each corresponding method on the client side and the component side, extract the correspondence between arguments (Fig. 4
reference).

【0011】(6) クライアント側およびコンポーネント
側のメソッドおよび引数の対応関係を利用して,クライ
アント側インタフェースを実装する新たなコンポーネン
トを定義する(図5参照)。
(6) A new component implementing the client-side interface is defined by using the correspondence between the methods and arguments on the client side and the component side (see FIG. 5).

【0012】(7) その内部に再利用するコンポーネント
を集約して,インタフェース側メソッドが起動される
と,メソッドおよび引数の対応関係から適切にコンポー
ネント側のメソッドが起動されるコードを自動生成する
(図6参照)。
(7) The components to be reused are aggregated therein, and when the interface-side method is activated, a code for appropriately invoking the component-side method is automatically generated from the correspondence between the method and the argument ( See FIG. 6).

【0013】以上説明したように,クライアント側イン
タフェースを実装して再利用するコンポーネントを集約
するコードは,従来手書きしてきたが,本発明によれ
ば,そのコードを自動生成できるため,アプリケーショ
ンプログラマの負担を軽減することができる。
As described above, the code for implementing the client-side interface and aggregating the components to be reused has been conventionally handwritten. However, according to the present invention, the code can be automatically generated, so that the burden on the application programmer is increased. Can be reduced.

【0014】[0014]

【発明の実施の形態】図2ないし図6の処理フローチャ
ートに従って,図7に示すコンポーネント側インタフェ
ースおよび図8に示すクライアント側インタフェースの
記述から,図9に示すプログラミングコードが自動生成
される様子を説明することで,本発明の実施の形態を示
す。
DESCRIPTION OF THE PREFERRED EMBODIMENTS A description will be given of how a programming code shown in FIG. 9 is automatically generated from a description of a component-side interface shown in FIG. 7 and a client-side interface shown in FIG. 8 in accordance with the processing flowcharts of FIGS. Thus, an embodiment of the present invention will be described.

【0015】本発明の実施の形態の全体構成としては,
「インタフェースマッチングルーチン」が「メソッド順
序対応付ルーチン」を呼び出し,「メソッド順序対応付
ルーチン」が「引数順序対応付ルーチン」を呼び出し,
「インタフェースマッチングルーチン」が終了すると
「グルーコード作成ルーチン」に遷移し,「グルーコー
ド作成ルーチン」が「メソッドコード作成ルーチン」を
呼び出す構成になっている。
The overall configuration of the embodiment of the present invention is as follows.
The "interface matching routine" calls the "method order corresponding routine", the "method order corresponding routine" calls the "argument order corresponding routine",
When the “interface matching routine” ends, the process transits to the “glue code creation routine”, and the “glue code creation routine” calls the “method code creation routine”.

【0016】本例では,インタフェースおよびメソッド
は下記のように定義する。 インタフェース:メソッド1,メソッド2,…,メソッ
ドN メソッド:返値型 メソッド名(引数型1 引数名1,
引数型2 引数名2,…,引数型N 引数名N) 例えば,図8に示したインタフェースでは,メソッド1
は“ Integer getID (String name)”, メソッド2は
“ void putID (String name, Integer ID)”,メソッ
ド3は“ void setID (Integer ID, String name)”,
メソッド数は3となる。また,メソッド1に関しては,
返値型 Integer,メソッド名は getID,引数型1は Str
ing,引数名1はname,引数数は1となる。この定義によ
ると,各メソッドは下記のように分類できる。
In this example, the interfaces and methods are defined as follows. Interface: Method 1, Method 2, ..., Method N Method: Return type Method name (Argument type 1 Argument name 1,
Argument type 2 Argument name 2, ..., argument type N Argument name N) For example, in the interface shown in FIG.
Is “Integer getID (String name)”, method 2 is “void putID (String name, Integer ID)”, method 3 is “void setID (Integer ID, String name)”,
The number of methods is 3. For method 1,
Return type Integer, method name is getID, argument type 1 is Str
ing, argument name 1 is name, and the number of arguments is 1. According to this definition, each method can be classified as follows.

【0017】 インタフェース名 メソッド名 引数数 返値型 Iclient getID 1 Integer Iclient putID 2 void Iclient setID 2 void Icomponent1 setIt 2 void Icomponent2 putIt 2 void Icomponent2 getIt 1 Integer Icomponent2 dummy 2 Integer 〔1〕インタフェースマッチングの例 図2は,インタフェースマッチングルーチンの処理フロ
ーチャートである。
Interface name Method name Number of arguments Return type Iclient getID 1 Integer Iclient putID 2 void Iclient setID 2 void Icomponent1 setIt 2 void Icomponent2 putIt 2 void Icomponent2 getIt 1 Integer Icomponent2 dummy 2 Integer [1] Example of interface matching FIG. 4 is a processing flowchart of an interface matching routine.

【0018】インタフェースマッチングルーチンに関し
て,クライアント側インタフェース記述(図8)および
コンポーネント側インタフェース記述(図7)を入力し
た際の例について説明する。
An example of the interface matching routine when a client-side interface description (FIG. 8) and a component-side interface description (FIG. 7) are input will be described.

【0019】インタフェースマッチングルーチンにおい
て,入力はクライアント側インタフェース,コンポーネ
ント側インタフェース1,…,インタフェースNであ
り,出力は,クライアント側・コンポーネント側のメソ
ッド間対応関係,各メソッドごとの引数間対応関係であ
る。
In the interface matching routine, the inputs are the client-side interface, the component-side interfaces 1,..., And the interface N, and the outputs are the client-to-component side correspondence between methods and the argument correspondence between each method. .

【0020】(1) コンポーネント側が複数のインタフェ
ースであれば,各インタフェースが持つメソッドをコン
ポーネント側メソッドとして認識する(ステップS10
1)。本例では,コンポーネント側インタフェースが2
個存在するため,4個のメソッドをコンポーネント側メ
ソッドとして認識する。
(1) If the component side has a plurality of interfaces, the method of each interface is recognized as a component side method (step S10).
1). In this example, the component side interface is 2
, Four methods are recognized as component-side methods.

【0021】(2) クライアント側メソッド数とコンポー
ネント側メソッド数を比較する(ステップS102から
ステップS103)。本例では,クライアント側が3,
コンポーネント側が4となり,コンポーネント側が多数
なのでステップS104に遷移する。
(2) The number of client-side methods and the number of component-side methods are compared (steps S102 to S103). In this example, the client side is 3,
Since the number of components is 4, and the number of components is large, the process proceeds to step S104.

【0022】(3) 返値型および引数数(以下,条件とい
う)が同じメソッドごとにメソッド数を集計して,クラ
イアント側とコンポーネント側で突合する(ステップS
104)。本例では,条件ごとにメソッドを分類すると
下記のようになり,引数数:1,返値型:Integer およ
び引数数:2,返値型:voidの条件については,クライ
アント側およびコンポーネント側でメソッド数は一致す
るが,引数数:2,返値型:Integer の条件では一致し
ない。
(3) The number of methods is totaled for each method having the same return type and the same number of arguments (hereinafter referred to as conditions), and the client side and the component side match (step S).
104). In this example, the methods are classified as follows for each condition. For the conditions of the number of arguments: 1, return type: Integer and the number of arguments: 2, return type: void, the method is used on the client side and component side. The numbers match, but they do not match under the conditions of number of arguments: 2, return type: Integer.

【0023】 クライアント側 : 引数数 返値型 メソッド数 1 Integer 1 2 void 2 コンポーネント側: 引数数 返値型 メソッド数 2 void 2 1 Integer 1 2 Integer 1 (4) コンポーネント側が多数の場合は,クライアント側
と同数になるように,コンポーネント側メソッドを考慮
から外す(ステップS105)。なお,候補が複数あ
り,曖昧な場合には必要な情報を表示して利用者に選択
させる。本例では,引数数:2,返値型:Integer の条
件に関して,クライアント側0個でコンポーネント側1
個となるので,クライアント側と同数になるようにコン
ポーネント側のメソッド(dummy) を考慮から外す。
Client side: number of arguments Return value number of methods 1 Integer 1 2 void 2 Component side: number of arguments Return value number of methods 2 void 21 Integer 1 2 Integer 1 (4) If there are many components, client side The component side method is excluded from consideration so that the number becomes the same as (step S105). In addition, when there are a plurality of candidates and it is ambiguous, necessary information is displayed to allow the user to select. In this example, regarding the number of arguments: 2, the return type: Integer, 0 components on the client side and 1 component side
Therefore, the component side method (dummy) is excluded from consideration so that the number is the same as the client side.

【0024】(5) 条件ごとのメソッド数がクライアント
側とコンポーネント側で一致するかを確認する(ステッ
プS106)。本例では,一致するのでステップS10
7に遷移する。
(5) It is confirmed whether the number of methods for each condition matches on the client side and the component side (step S106). In this example, since they match, step S10
Transition to 7.

【0025】(6) 条件が同じメソッドごとに,返値型お
よび引数数を属性として持った条件リストを作成する
(ステップS107)。本例では下記のような条件リス
トが作成される。
(6) A condition list having a return type and the number of arguments as attributes is created for each method having the same condition (step S107). In this example, the following condition list is created.

【0026】 (7) 各条件に対してメソッド順序対応付ルーチンを呼び
出す(ステップS108からステップS110)。本例
では下記のような結果が返却される。
[0026] (7) Call a method order correspondence routine for each condition (steps S108 to S110). In this example, the following result is returned.

【0027】条件1に対する結果: クライアント側 コンポーネント側 getID getIt メソッド ID It 引数 setID setIt メソッド 条件2に対する結果: クライアント側 コンポーネント側 putID putIt メソッド name index 引数 ID It 引数 setID setIt メソッド ID It 引数 name index 引数 (8) 各条件に全て対応関係が存在するかを調査する(ス
テップS111からステップS112)。本例では,各
条件にすべて対応関係が存在するので,グルーコード作
成ルーチンに遷移する(ステップS113)。 〔2〕メソッド順序対応付の例 図3は,メソッド順序対応付ルーチンの処理フローチャ
ートである。
Result for condition 1: client-side component side getID getIt method ID It argument setID setIt method Result for condition 2: client-side component side putID putIt method name index argument ID It argument setID setIt method ID It argument name index argument (8 It is checked whether all the conditions have a corresponding relationship (steps S111 to S112). In this example, since there is a correspondence between all of the conditions, the process proceeds to the glue code creation routine (step S113). [2] Example of method order association FIG. 3 is a processing flowchart of a method order association routine.

【0028】メソッド順序対応付ルーチンに関して,上
述のインタフェースマッチングの例における条件2を入
力した際の実施の形態について説明する。メソッド順序
対応付ルーチンへの入力は,クライアント側およびコン
ポーネント側で条件(引数数および返値型)を満たすメ
ソッド1,…,メソッドNである。出力は,クライアン
ト側とコンポーネント側のメソッド対応関係,各メソッ
ドにおける引数の対応関係である。
A description will now be given of an embodiment in which the condition 2 in the above-described example of interface matching is input with respect to the method order correspondence routine. The inputs to the method order correspondence routine are methods 1,..., Method N that satisfy the conditions (the number of arguments and the return type) on the client side and the component side. The output is the method correspondence between the client side and the component side, and the correspondence between the arguments in each method.

【0029】クライアント側およびコンポーネント側で
条件2を満たすメソッドを下記に示す。 クライアント側 void putID(String name, Integer ID) void setID(Integer ID, String name) コンポーネント側 void setIt(String index, Integer It) void putIt(Integer It, String index) (1) コンポーネント側メソッド群(メソッド1,…,メ
ソッドN)に関して総当たりのメソッド順序リストを作
成する(ステップS201)。本例では,下記のような
メソッド順序リストが作成される。
The methods satisfying the condition 2 on the client side and the component side are shown below. Client side void putID (String name, Integer ID) void setID (Integer ID, String name) Component side void setIt (String index, Integer It) void putIt (Integer It, String index) (1) Component side method group (method 1 ,..., Method N), a brute force method order list is created (step S201). In this example, the following method order list is created.

【0030】第1メソッド順序: 1 void setIt(String index, Integer It) 2 void putIt(Integer It, String index) 第2メソッド順序: 1 void putIt(Integer It, String index) 2 void setIt(String index, Integer It) (2) メソッド順序ごとに引数順序対応ルーチンを呼び出
す(ステップS202からステップS204)。本例で
は,下記のような結果が返却される。
First method order: 1 void setIt (String index, Integer It) 2 void putIt (Integer It, String index) Second method order: 1 void putIt (Integer It, String index) 2 void setIt (String index, Integer It) (2) An argument order correspondence routine is called for each method order (steps S202 to S204). In this example, the following result is returned.

【0031】第1メソッド順序の結果: クライアント側 コンポーネント側 putID setIt メソッド name index 引数 ID It 引数 setID putIt メソッド ID It 引数 name index 引数 第2メソッド順序での結果: クライアント側 コンポーネント側 putID putIt メソッド name index 引数 ID It 引数 setID setIt メソッド ID It 引数 name index 引数 (3) メソッド順序ごとに対応関係が複数あり曖昧な場合
には,利用者に候補から選択させて,結果を記憶する
(ステップS205)。本例では,第1および第2メソ
ッド順序ごとに対応関係があるので,利用者に選択させ
る。以下では,第2メソッド順序での結果を選択したと
する。
Result of the first method order: PutID setIt method on the client side component name index argument ID It argument setID putIt method ID It argument name index argument Result in the second method order: putID putIt method name index argument on the client side component side ID It Argument setID setIt Method ID It Argument name index Argument (3) If there is more than one correspondence in each method order, the user is made to select from the candidates and the result is stored (step S205). In this example, since there is a correspondence between the first and second method orders, the user is made to select. Hereinafter, it is assumed that the result in the second method order is selected.

【0032】(4) 本ルーチンの呼び出し元へ戻る(ステ
ップS206)。 〔3〕引数順序対応付の例 図4は,引数順序対応付ルーチンの処理フローチャート
である。
(4) Return to the caller of this routine (step S206). [3] Example of Argument Order Correlation FIG. 4 is a processing flowchart of an argument order association routine.

【0033】引数順序対応付ルーチンに関して,上述の
メソッド順序対応付の例における第2メソッド順序を入
力した際の実施の形態について説明する。引数順序対応
付ルーチンへの入力は,クライアント側メソッド順序
(メソッド1,…,N),コンポーネント側メソッド順
序(メソッド1,…,N)であり,出力は,各メソッド
における引数の対応関係(存在しない場合:NULL)
である。
With respect to the argument order associating routine, an embodiment when the second method order in the above example of the method order associating is input will be described. The input to the argument ordering routine is the client-side method order (method 1,..., N) and the component-side method order (method 1,..., N), and the output is the argument correspondence (existence) for each method. If not: NULL)
It is.

【0034】クライアント側およびコンポーネント側で
入力されたメソッド順序を下記に示す。 クライアント側 1:void putID(String name, Integer ID) 2:void setID(Integer ID, String name) コンポーネント側 1:void putIt(Integer It, String index) 2:void setIt(String index, Integer It) (1) クライアント側メソッド順序とコンポーネント側メ
ソッド順序に関して,直接対応するメソッド対リストを
作成する(ステップS301)。本例では,下記のよう
なメソッド対リストが作成される。
The method order input on the client side and the component side is shown below. Client side 1: void putID (String name, Integer ID) 2: void setID (Integer ID, String name) Component side 1: void putIt (Integer It, String index) 2: void setIt (String index, Integer It) (1 A method pair list is created that directly corresponds to the client-side method order and the component-side method order (step S301). In this example, the following method pair list is created.

【0035】 1:クライアント側:void putID(String name, Integer ID) コンポーネント側:void putIt(Integer It, String index) 2:クライアント側:void setID(Integer ID, String name) コンポーネント側:void setIt(String index, Integer It) (2) メソッド対ごとに,コンポーネント側メソッドで引
数の順序として可能な組み合わせを作成して,クライア
ント側と引数型が一致する対応関係を抽出する(ステッ
プS302からステップS304)。本例では,第1メ
ソッド対に対しては下記のような比較が実行される。
1: Client side: void putID (String name, Integer ID) Component side: void putIt (Integer It, String index) 2: Client side: void setID (Integer ID, String name) Component side: void setIt (String index, Integer It) (2) For each method pair, create a possible combination of the order of the arguments in the component-side method, and extract the correspondence in which the argument types match the client side (steps S302 to S304). In this example, the following comparison is performed on the first method pair.

【0036】 クライアント側 void putID(String name, Integer ID) コンポーネント側 void putIt(Integer It, String index) 不一致 void putIt(String index, Integer It) 一致 (3) メソッド対ごとに,引数の順序として複数の対応関
係が存在する場合には,利用者に候補から選択させて,
結果を記憶する(ステップS305)。本例では,第1
メソッド対に関する複数の対応関係は存在しないので,
そのまま下記のような対応関係が記憶される。
Client side void putID (String name, Integer ID) Component side void putIt (Integer It, String index) No match void putIt (String index, Integer It) Match (3) For each method pair, If there is a correspondence, let the user select from the candidates,
The result is stored (step S305). In this example, the first
Since there are no multiple correspondences for method pairs,
The following correspondence is stored as it is.

【0037】 クライアント側 コンポーネント側 putID putIt メソッド name index 引数 ID It 引数 (4) 全てのメソッド対に一致する引数の順序が存在する
場合,その対応関係を記憶する(ステップS306)。
例では,全てのメソッド対に一致する対応関係があるの
で,これらを記憶する。第2メソッド対に関しては,以
下の対応関係が記憶される。
Client side component side putID putIt method name index argument ID It argument (4) If there is an order of arguments that matches all method pairs, the correspondence is stored (step S306).
In the example, since there is a correspondence corresponding to all the method pairs, these are stored. For the second method pair, the following correspondence is stored.

【0038】 クライアント側 コンポーネント側 setID setIt メソッド ID It 引数 name index 引数 (5) 本ルーチンの呼び出し元へ戻る(ステップS30
7)。 〔4〕グルーコード作成の例 図5は,グルーコード作成ルーチンの処理フローチャー
トである。
Client side component side setID setIt method ID It argument name index argument (5) Return to caller of this routine (step S30)
7). [4] Example of Glue Code Creation FIG. 5 is a processing flowchart of a glue code creation routine.

【0039】グルーコード作成ルーチンに関して,図7
および図8に示すコンポーネント側およびクライアント
側インタフェースと,本例におけるインタフェースマッ
チングルーチンが出力する結果を入力した際の例につい
て説明する。
FIG. 7 shows the glue code creation routine.
A description will be given of an example in which the component-side and client-side interfaces shown in FIG. 8 and the result output by the interface matching routine in this example are input.

【0040】グルーコード作成ルーチンへの入力は,ク
ライアント側インタフェース,コンポーネント側インタ
フェース1,…,N,クライアント側・コンポーネント
側のメソッド間対応関係,各メソッドごとの引数間対応
関係である。出力は,クライアント側インタフェースを
操作することで透過的にコンポーネント側インタフェー
スを操作できるコード(グルーコード)である。
The inputs to the glue code creation routine are the client-side interface, the component-side interfaces 1,..., N, the correspondence between methods on the client and component sides, and the correspondence between arguments for each method. The output is a code (glue code) that can operate the component-side interface transparently by operating the client-side interface.

【0041】インタフェースマッチングルーチンが出力
する結果を下記に示す。 クライアント側 コンポーネント側 getID getIt メソッド ID It 引数 setID setIt メソッド クライアント側 コンポーネント側 putID putIt メソッド name index 引数 ID It 引数 setID setIt メソッド ID It 引数 name index 引数 (1) クライアント側インタフェースを実装するコンポー
ネント定義ヘッダコードを出力し,コンポーネント側イ
ンタフェースごとにコンポーネント側インタフェースを
実装したコンポーネントをインスタンス化し,参照を得
るコードを出力する(ステップS401からステップS
402)。本例では,下記のコードが出力される。
The results output by the interface matching routine are shown below. Client side component side getID getIt method ID It argument setID setIt method client side component side putID putIt method name index argument ID It argument setID setIt method ID It argument name index argument (1) Outputs component definition header code that implements client side interface Then, the component implementing the component-side interface is instantiated for each component-side interface, and a code for obtaining a reference is output (from step S401 to step S401).
402). In this example, the following code is output.

【0042】 (2) クライアント側インタフェースにおけるメソッド順
序を用いてメソッドリストを作成する(ステップS40
3)。本例では,下記のようなメソッドリストが作成さ
れる。
[0042] (2) Create a method list using the method order in the client-side interface (step S40)
3). In this example, the following method list is created.

【0043】 1:Integer getID(String name) 2:void putID(String name, Integer ID) 3:void setID(Integer ID, String name) (3) メソッドごとにメソッドコード作成ルーチンを呼び
出す(ステップS404からステップS406)。本例
では,下記のようなコードが出力される。
1: Integer getID (String name) 2: void putID (String name, Integer ID) 3: void setID (Integer ID, String name) (3) Call a method code creation routine for each method (from step S404 S406). In this example, the following code is output.

【0044】 (4) コンポーネント定義フッタコードを出力する(ステ
ップS407)。本例では,下記のコードが出力され
る。
[0044] (4) The component definition footer code is output (step S407). In this example, the following code is output.

【0045】} (5) 終了する(ステップS408)。 〔5〕メソッドコード作成の例 図6は,メソッドコード作成ルーチンの処理フローチャ
ートである。
} (5) End (step S408). [5] Example of Method Code Creation FIG. 6 is a processing flowchart of a method code creation routine.

【0046】メソッドコード作成ルーチンに関して,上
述のグルーコード作成の例における第2メソッドを入力
した際の実施の形態について説明する。メソッドコード
作成ルーチンへの入力は,クライアント側メソッド,出
力は,インスタンス化してあるコンポーネントであっ
て,クライアント側の当該メソッドに対応するメソッド
を起動するコードである。
An embodiment of the method code creation routine when the second method in the example of glue code creation described above is input will be described. The input to the method code creation routine is a client-side method, and the output is a code that activates a method corresponding to the client-side method, which is an instantiated component.

【0047】グルーコード作成の例における第2メソッ
ドを下記に示す。 void putID(String name, Integer ID) (1) 当該メソッドに関してクライアント側インタフェー
スと同一のメソッドを宣言するコードを出力する(ステ
ップS501)。本例では,下記のようなコードが出力
される。
The second method in the example of glue code creation is shown below. void putID (String name, Integer ID) (1) A code for declaring the same method as that of the client-side interface for the method is output (step S501). In this example, the following code is output.

【0048】 public void putID(String name, Integer ID) { (2) 当該メソッドが値を返す場合,値を返すコード
(例:return)を出力する(ステップS502からステ
ップS503)。本例では,入力されたクライアント側
メソッドは値を返さないため,何も出力しない。
Public void putID (String name, Integer ID) (2) When the method returns a value, a code for returning the value (eg, return) is output (steps S502 to S503). In this example, nothing is output because the input client-side method does not return a value.

【0049】(3) コンポーネント側で当該メソッドに対
応するメソッドを含むインタフェースを実装したコンポ
ーネントのインスタンスにおいて,コンポーネント側で
当該メソッドに対応するメソッドを起動するコードを出
力する(ステップS504)。本例では,抽出されてい
るメソッド対応関係から,putID はコンポーネント側メ
ソッドputIt に対応しており,putIt はコンポーネント
Ccomponent1で実装されているため,インスタンスへの
参照はp1となる。結果として,下記のようなコードが出
力される。
(3) In an instance of a component in which an interface including a method corresponding to the method is mounted on the component side, a code for activating the method corresponding to the method is output on the component side (step S504). In this example, from the extracted method correspondence, putID corresponds to the component side method putIt, and putIt corresponds to the component
Since it is implemented in Ccomponent1, the reference to the instance is p1. As a result, the following code is output.

【0050】p1.putIt( (4) コンポーネント側で対応するメソッドの引数リスト
を作成する(ステップS505)。本例では,putIt の
引数リストから下記のような引数リストが作成される。
P1.putIt ((4) An argument list of the corresponding method is created on the component side (step S505) In this example, the following argument list is created from the argument list of putIt.

【0051】 1: Integer It 2: String index (5) 引数ごとにクライアント側で当該引数に対応する引
数名を出力する(ステップS506からステップS50
8)。本例では,Itはクライアント側でIDに,index は
nameに対応するため,下記のようなコードが出力され
る。
1: Integer It 2: String index (5) For each argument, the client outputs an argument name corresponding to the argument (from step S506 to step S50)
8). In this example, It is an ID on the client side, and index is
The following code is output to correspond to name.

【0052】ID, name (6) 当該メソッドに関してフッタコードを出力する(ス
テップS509)。本例では,下記に示すフッタコード
を出力する。
ID, name (6) A footer code is output for the method (step S509). In this example, the following footer code is output.

【0053】 (7) 本ルーチンの呼び出し元へ戻る(ステップS51
0)。
[0053] (7) Return to the caller of this routine (step S51)
0).

【0054】[0054]

【発明の効果】以上説明したように,本発明によれば,
コンポーネント側インタフェースとクライアント側イン
タフェースとが異なる場合に,両者を仲介するコードを
自動生成することができる。
As described above, according to the present invention,
When the component-side interface and the client-side interface are different, it is possible to automatically generate a code that mediates both.

【0055】これにより,クライアント側インタフェー
スを実装するコンポーネントを新たに定義して,メソッ
ドおよび引数の対応関係を考慮しながら,再利用するコ
ンポーネントを集約するコードを手書きするという従来
の煩雑な処理をなくし,アプリケーションプログラマの
負担を軽減することができるという効果を奏する。
This eliminates the conventional complicated processing of newly defining a component implementing the client-side interface and handwriting a code for aggregating components to be reused while considering the correspondence between methods and arguments. This has the effect of reducing the burden on the application programmer.

【図面の簡単な説明】[Brief description of the drawings]

【図1】本発明の原理説明図である。FIG. 1 is a diagram illustrating the principle of the present invention.

【図2】インタフェースマッチングルーチンの処理フロ
ーチャートである。
FIG. 2 is a processing flowchart of an interface matching routine.

【図3】メソッド順序対応付ルーチンの処理フローチャ
ートである。
FIG. 3 is a processing flowchart of a method order association routine.

【図4】引数順序対応付ルーチンの処理フローチャート
である。
FIG. 4 is a processing flowchart of an argument order associating routine.

【図5】グルーコード作成ルーチンの処理フローチャー
トである。
FIG. 5 is a processing flowchart of a glue code creation routine.

【図6】メソッドコード作成ルーチンの処理フローチャ
ートである。
FIG. 6 is a processing flowchart of a method code creation routine.

【図7】コンポーネント側インタフェースの例を示す図
である。
FIG. 7 is a diagram illustrating an example of a component-side interface.

【図8】クライアント側インタフェースの例を示す図で
ある。
FIG. 8 is a diagram illustrating an example of a client-side interface.

【図9】クライアント側インタフェースを実装するコン
ポーネントのインタフェースの例を示す図である。
FIG. 9 is a diagram illustrating an example of an interface of a component that implements a client-side interface.

【符号の説明】[Explanation of symbols]

1 グルーコード作成装置 1 glue code creation device

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】 クライアントが要請するインタフェース
と異なるインタフェースを持った1個以上のソフトウェ
アコンポーネントを再利用する方法において,クライア
ント側およびコンポーネント側のインタフェース記述か
らメソッドおよび引数の順序による差違を吸収し,メソ
ッドおよび引数の対応関係を抽出し,メソッドおよび引
数の対応関係が複数存在して曖昧な場合には利用者に候
補から選択させ,メソッドおよび引数の対応関係を利用
してクライアント側インタフェースを実装した新たなコ
ンポーネントを定義し,そのコンポーネント内部に再利
用するコンポーネントを集約するプログラミングコード
を自動生成することを特徴とするインタフェースマッチ
ング方法。
1. A method for reusing one or more software components having an interface different from an interface requested by a client, wherein differences in the order of methods and arguments are absorbed from interface descriptions on a client side and a component side. And the correspondence between parameters and arguments are extracted. If there is more than one correspondence between methods and arguments and the user is ambiguous, the user is selected from candidates, and the client-side interface is implemented using the correspondence between methods and arguments. An interface matching method characterized by automatically generating programming code for defining a component and aggregating components to be reused inside the component.
【請求項2】 クライアントが要請するインタフェース
と異なるインタフェースを持った1個以上のソフトウェ
アコンポーネントを再利用する方法を計算機に実行させ
るためのプログラムを記録した記録媒体において,クラ
イアント側およびコンポーネント側のインタフェース記
述からメソッドおよび引数の順序による差違を吸収し,
メソッドおよび引数の対応関係を抽出し,メソッドおよ
び引数の対応関係が複数存在して曖昧な場合には利用者
に候補から選択させ,メソッドおよび引数の対応関係を
利用してクライアント側インタフェースを実装した新た
なコンポーネントを定義し,そのコンポーネント内部に
再利用するコンポーネントを集約するプログラミングコ
ードを自動生成する処理を,計算機に実行させるプログ
ラムを記録したことを特徴とするインタフェースマッチ
ングプログラムを記録した記録媒体。
2. An interface description on a client side and a component side in a recording medium storing a program for causing a computer to execute a method of reusing one or more software components having an interface different from an interface requested by a client. Absorbs differences due to the order of methods and arguments from
The correspondence between methods and arguments was extracted, and if there was more than one correspondence between methods and arguments, the user was selected from the candidates if ambiguous, and the client-side interface was implemented using the correspondence between methods and arguments. A recording medium on which an interface matching program is recorded, wherein a program for causing a computer to execute a process of defining a new component and automatically generating a programming code for aggregating components to be reused inside the component is recorded.
JP10161600A 1998-06-10 1998-06-10 Interface matching method and recording medium where interface matching program is recorded Pending JPH11353168A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP10161600A JPH11353168A (en) 1998-06-10 1998-06-10 Interface matching method and recording medium where interface matching program is recorded

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP10161600A JPH11353168A (en) 1998-06-10 1998-06-10 Interface matching method and recording medium where interface matching program is recorded

Publications (1)

Publication Number Publication Date
JPH11353168A true JPH11353168A (en) 1999-12-24

Family

ID=15738244

Family Applications (1)

Application Number Title Priority Date Filing Date
JP10161600A Pending JPH11353168A (en) 1998-06-10 1998-06-10 Interface matching method and recording medium where interface matching program is recorded

Country Status (1)

Country Link
JP (1) JPH11353168A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009238230A (en) * 2003-05-12 2009-10-15 An Mo Jeong Software development method using metadata expanded under component base environment and its development system
US7676794B2 (en) 2006-03-09 2010-03-09 International Business Machines Corporation Testing scenarios that sequentially execute a plurality of application program interfaces
JP2011521366A (en) * 2008-05-23 2011-07-21 イルデト カナダ コーポレーション System and method for generating a white-box implementation of a software application
JP2019527396A (en) * 2016-06-01 2019-09-26 ザ マスワークス, インクThe Mathworks, Inc. System and method for creating a model adapter

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH04241023A (en) * 1991-01-25 1992-08-28 Hitachi Ltd Program synthesizer

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH04241023A (en) * 1991-01-25 1992-08-28 Hitachi Ltd Program synthesizer

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009238230A (en) * 2003-05-12 2009-10-15 An Mo Jeong Software development method using metadata expanded under component base environment and its development system
JP2009238229A (en) * 2003-05-12 2009-10-15 An Mo Jeong Software development method using metadata expanded under component base environment and its development system
JP2009245441A (en) * 2003-05-12 2009-10-22 An Mo Jeong Software development method using metadata expanded under component board environment, and its development system
US7676794B2 (en) 2006-03-09 2010-03-09 International Business Machines Corporation Testing scenarios that sequentially execute a plurality of application program interfaces
JP2011521366A (en) * 2008-05-23 2011-07-21 イルデト カナダ コーポレーション System and method for generating a white-box implementation of a software application
JP2019527396A (en) * 2016-06-01 2019-09-26 ザ マスワークス, インクThe Mathworks, Inc. System and method for creating a model adapter
US11244090B2 (en) 2016-06-01 2022-02-08 The Mathworks, Inc. Systems and methods for extracting adjustable attributes of model components

Similar Documents

Publication Publication Date Title
CN112748908B (en) Method and device for developing Restful service based on SSM framework
US9747353B2 (en) Database content publisher
CN107463595A (en) A kind of data processing method and system based on Spark
US8775228B2 (en) Methods and apparatus for agreement-based automated service provisioning
US20120246614A1 (en) Automated generation of client/driver communication interfaces
JP7157716B2 (en) Database server device, server system and request processing method
US20110106724A1 (en) Entity morphing in metamodel-based tools
JP2019505885A (en) Subgraph interface generation
WO2017161989A1 (en) Preprocessing method and device for distributed database and computer storage medium
CN111966340A (en) Code generation method, device, equipment and medium based on Mybatis framework
CN110674205B (en) Single table query method, device, terminal and readable storage medium
US20060130011A1 (en) Extending existing model-to-model transformations
US11366704B2 (en) Configurable analytics for microservices performance analysis
CN112487075B (en) Method for integrating relational database data conversion operators and non-relational database data conversion operators
JPH11353168A (en) Interface matching method and recording medium where interface matching program is recorded
US11016830B2 (en) Entity-based service operation for object-based persistence
CN111259042B (en) Dynamic query method and system
Hauschildt et al. WOFLAN: a Petri-net-based Workflow Analyzer
CN110209699B (en) Data interface dynamic generation and execution method based on openEHR Composition template
CN112100260A (en) Interface engine-based multi-application data fusion method and system
CN108769028B (en) Method and device for assembling message
CN115809065A (en) Low-code development platform, data storage method and electronic equipment
US20090144752A1 (en) Unmanaged-to-managed aggregation
CN115729535A (en) Complex process application development framework based on automatic code generation
CN114296789A (en) Business processing method, device, equipment and storage medium based on full-flow configuration

Legal Events

Date Code Title Description
A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20040224

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20040629