JP2003186670A - Automatic generation device, automatic generation method and automatic generation program for database access component - Google Patents

Automatic generation device, automatic generation method and automatic generation program for database access component

Info

Publication number
JP2003186670A
JP2003186670A JP2001390323A JP2001390323A JP2003186670A JP 2003186670 A JP2003186670 A JP 2003186670A JP 2001390323 A JP2001390323 A JP 2001390323A JP 2001390323 A JP2001390323 A JP 2001390323A JP 2003186670 A JP2003186670 A JP 2003186670A
Authority
JP
Japan
Prior art keywords
access component
database access
record
automatic generation
repository
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
JP2001390323A
Other languages
Japanese (ja)
Inventor
Kazuhiko Hatamoto
和彦 畑本
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.)
Hitachi Information Systems Ltd
Original Assignee
Hitachi Information Systems Ltd
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 Hitachi Information Systems Ltd filed Critical Hitachi Information Systems Ltd
Priority to JP2001390323A priority Critical patent/JP2003186670A/en
Publication of JP2003186670A publication Critical patent/JP2003186670A/en
Pending legal-status Critical Current

Links

Landscapes

  • Stored Programmes (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide an automatic generation device, an automatic generation method and an automatic generation program for a database access component that achieves improvement in productivity and maintainability of program development. <P>SOLUTION: The automatic generation device is provided with an input device 30, with which a system developer inputs various data; a display device 20 that externally displays inputted data, data obtained by autocreation or the like; a repository 1, that stores schema definition information on a user database; a schema edition part 40, that stores the schema definition information inputted from a schema definition screen displayed on the display device 20 with the input device 30 in the repository 1; and a database access component creating part 10, that automatically generates a source program for a database access component 3 from the repository 1 and a template file 2 previously generated by the system developer. <P>COPYRIGHT: (C)2003,JPO

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【発明の属する技術分野】本発明は、多階層アーキテク
チャを採用するクライアント/サーバシステムにおいて
ファンクション層で作用するデータベースアクセスコン
ポーネントの自動生成装置,自動生成方法及び自動生成
プログラムに関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an automatic generation device, an automatic generation method and an automatic generation program for a database access component which operates in a function layer in a client / server system adopting a multi-layer architecture.

【0002】[0002]

【従来の技術】クライアント/サーバシステムの開発に
おいて、システムにデータベースアクセス処理機能を実
装させることは不可欠であるが、従来、システムへの実
装形態として、クライアントアプリケーションからデー
タベースに直接アクセスする2階層アーキテクチャが採
用されていた。しかし近年、システムの拡張性の向上を
図るため、データベースにアクセスする処理をコンポー
ネントとしてクライアントから分離し、新たに設けられ
たファンクション層においてデータベースアクセス処理
動作が行われるように構成した多階層アーキテクチャが
主流となってきている。
2. Description of the Related Art In developing a client / server system, it is indispensable to implement a database access processing function in the system. Conventionally, a two-layer architecture in which a client application directly accesses a database has been adopted as an implementation form in the system. It had been. However, in recent years, in order to improve the system extensibility, a multi-layered architecture is mainly used in which the process of accessing the database is separated from the client as a component and the database access process operation is performed in the newly provided function layer. Is becoming.

【0003】[0003]

【発明が解決しようとする課題】ここで、前記データベ
ースアクセスコンポーネントは、データベースのテーブ
ルスキーマ毎に個別にプログラミングする必要がある
が、個別にプログラミングするとなると、プログラム開
発の生産性,効率性が良くないという不具合があった。
また、このデータベースアクセスプログラムを自動生成
する従来の技術として、例えば特開平5−289919
号公報記載の生成方式があるが、この生成方式では、旧
来のシステムアーキテクチャにはうまく適合できても、
近年の多階層アーキテクチャにおけるデータベースアク
セスコンポーネントの自動生成には適用できない。
The database access component needs to be individually programmed for each table schema of the database, but if it is programmed individually, the productivity and efficiency of program development are not good. There was a problem.
Further, as a conventional technique for automatically generating this database access program, for example, Japanese Patent Laid-Open No. 5-289919
Although there is a generation method described in Japanese Patent Publication, even if this generation method can be well adapted to the old system architecture,
It cannot be applied to automatic generation of database access components in modern multi-tier architecture.

【0004】そこで本発明の目的は、多階層アーキテク
チャに基づいたクライアント/サーバシステムの開発に
おけるデータベースアクセスコンポーネントのソースプ
ログラムを自動生成し、プログラム開発の生産性及び保
守性を向上することを実現するデータベースアクセスコ
ンポーネントの自動生成装置,自動生成方法及び自動生
成プログラムを提供することである。
Therefore, an object of the present invention is to automatically generate a source program of a database access component in the development of a client / server system based on a multi-layer architecture, and to realize a database for improving productivity and maintainability of program development. An automatic generation device, an automatic generation method, and an automatic generation program for access components are provided.

【0005】[0005]

【課題を解決するための手段】前記目的を達成するため
に、本発明のデータアクセスコンポーネント自動生成装
置は、システム開発者が各種データを入力する入力装置
と、入力データや自動生成されたデータ等を外部に表示
する表示装置と、ユーザデータベースのスキーマ定義情
報を格納するリポジトリと、前記表示装置に表示された
スキーマ定義画面から前記入力装置により入力されたス
キーマ定義情報を前記リポジトリに格納するスキーマ編
集部と、前記リポジトリと,システム開発者により予め
作成されたテンプレートファイルとからデータベースア
クセスコンポーネントのソースプログラムを自動生成す
るデータベースアクセスコンポーネント生成部と、を具
備することを主な特徴としている。
In order to achieve the above object, the data access component automatic generation device of the present invention is an input device for a system developer to input various data, input data, automatically generated data, and the like. Displaying externally, a repository storing schema definition information of a user database, and a schema edit storing schema definition information input by the input device from the schema definition screen displayed on the display device in the repository The main feature is that it includes a unit, the repository, and a database access component generation unit that automatically generates a source program of a database access component from a template file created in advance by a system developer.

【0006】また、本発明のデータアクセスコンポーネ
ント自動生成方法は、読み込んだテンプレートファイル
の一件分のレコード中に仮記号が含まれているか否か判
定する判定工程と、前記判定工程にて仮記号が含まれて
いると判定された場合、リポジトリ内のスキーマ定義情
報からテーブル名あるいはカラム名を取得して、レコー
ド内の仮記号と,当該仮記号に対応する文字列との置換
処理を行う置換工程と、置換後の文字列を含む一件分の
レコードをデータフクセスコンポーネントのソースプロ
グラムとして1レコード出力する出力工程と、を有する
ことを主な特徴としている。
Further, the data access component automatic generation method of the present invention includes a determination step of determining whether or not a temporary symbol is included in one record of the read template file, and a temporary symbol in the determination step. If it is determined that the table name or column name is included in the schema definition information in the repository, the replacement is performed by replacing the temporary symbol in the record with the character string corresponding to the temporary symbol. The main feature is that it has a process and an output process of outputting one record containing a character string after replacement as a source program of the data access component.

【0007】更に、本発明のデータアクセスコンポーネ
ント自動生成プログラムは、コンピュータに、読み込ん
だテンプレートファイルの一件分のレコード中に仮記号
が含まれているか否か判定する判定機能と、前記判定機
能にて仮記号が含まれていると判定された場合、リポジ
トリ内のスキーマ定義情報からテーブル名あるいはカラ
ム名を取得して、レコード内の仮記号と,当該仮記号に
対応する文字列との置換処理を行う置換機能と、置換後
の文字列を含む一件分のレコードをデータフクセスコン
ポーネントのソースプログラムとして1レコード出力す
る出力機能と、を実現させることを主な特徴としてい
る。
Further, the data access component automatic generation program of the present invention has a determination function of determining whether or not a computer includes a temporary symbol in one record of a read template file, and the determination function. If it is determined that the temporary symbol is included in the record, the table name or column name is acquired from the schema definition information in the repository, and the temporary symbol in the record is replaced with the character string corresponding to the temporary symbol. The main feature is to realize a replacement function for performing the above, and an output function for outputting one record including the replaced character string as a source program of the data access component as one record.

【0008】[0008]

【発明の実施の形態】以下、本発明の一実施形態による
データベースアクセスコンポーネントの自動生成装置
を、図を参照して説明する。
BEST MODE FOR CARRYING OUT THE INVENTION An automatic generation apparatus for a database access component according to an embodiment of the present invention will be described below with reference to the drawings.

【0009】まず、本実施形態による自動生成装置の構
成について説明する前に、データベースアクセスコンポ
ーネントを有するクライアント/サーバシステムの多階
層アーキテクチャの一例を、図2を参照して説明する。
本実施形態におけるクライアント/サーバシステムのア
ーキテクチャは、ユーザ・インターフェイス部分のクラ
イアント(プレゼンテーション)層110と,データベ
ースアクセス処理を行うファンクション層120と,デ
ータベースを管理するデータ層130との3階層から成
るものである。
First, before describing the configuration of the automatic generation apparatus according to the present embodiment, an example of a multi-layer architecture of a client / server system having a database access component will be described with reference to FIG.
The architecture of the client / server system in this embodiment is composed of three layers, that is, a client (presentation) layer 110 of a user interface portion, a function layer 120 that performs a database access process, and a data layer 130 that manages a database. is there.

【0010】前記クライアント層110としては、リッ
チクライアント103とシンクライアント104とがあ
る。前記リッチクライアント103は、ブラウザベース
以外のアプリケーションを管理するものであり、一方の
前記シンクライアント104は、ブラウザベースのアプ
リケーションを管理するものである。
The client layer 110 includes a rich client 103 and a thin client 104. The rich client 103 manages applications other than browser-based applications, while the thin client 104 manages browser-based applications.

【0011】前記ファンクション層120には、データ
ベースアクセスコンポーネント3とビジネスコンポーネ
ント102とがある。前記データベースアクセスコンポ
ーネント3は、データ層130のユーザデータベース1
01内に格納されるデータの取り出し,追加,更新及び
削除の各処理動作を行う、即ち、単純にユーザデータベ
ース101内のデータのアクセスを専用に行うコンポー
ネントである。つまり、データベースアクセスコンポー
ネント3はビジネスルールを有していない。一方、前記
ビジネスコンポーネント102は、業務アプリケーショ
ンのビジネスルールを保有しており、データベースアク
セスを行うためにデータベースアクセスコンポーネント
3の呼び出し処理を行うものである。
The function layer 120 has a database access component 3 and a business component 102. The database access component 3 is the user database 1 of the data layer 130.
01 is a component that performs processing operations of fetching, adding, updating, and deleting data stored in 01, that is, simply accessing data in the user database 101 exclusively. That is, the database access component 3 has no business rules. On the other hand, the business component 102 holds the business rule of the business application, and executes the calling process of the database access component 3 to access the database.

【0012】尚、前記ビジネスルールとは、例えば本体
価格と税額という二つのカラムを有する商品テーブルが
存在する場合における「税額=本体価格*0.05」という
計算式等のことを指す。このようなビジネスルールは普
遍的なものでなく、法律の改正等により変更される可能
性がある。一般には、前記ビジネスルールはビジネスコ
ンポーネント102に実装されている。
[0012] The business rule refers to a formula such as "tax amount = body price * 0.05" in the case where there is a commodity table having two columns of a body price and a tax amount. Such business rules are not universal and may change due to revision of laws. Generally, the business rules are implemented in the business component 102.

【0013】<データベースアクセスコンポーネントの
自動生成装置の構成>以上のような構成のクライアント
/サーバシステムでは、クライアント層110のリッチ
クライアント103もしくはシンクライアント104
は、ビジネスコンポーネント102及びデータベースア
クセスコンポーネント3を介して、ユーザデータベース
101とデータのやり取りを行うこととなる。このよう
なクライアント/サーバシステムにおけるデータベース
アクセスコンポーネント3の自動生成装置の構成につい
て図1を参照して説明する。尚、以下本実施形態では、
任意商品の商品コード,商品名,本体価格,税額に関す
るユーザデータベース101内の商品テーブルにアクセ
スするデータベースアクセスコンポーネント3の自動生
成を例に取り説明する。
<Structure of Automatic Generating Device for Database Access Component> In the client / server system having the above structure, the rich client 103 or the thin client 104 of the client layer 110 is used.
Exchanges data with the user database 101 via the business component 102 and the database access component 3. The configuration of the automatic generation device of the database access component 3 in such a client / server system will be described with reference to FIG. In the following, in the present embodiment,
The automatic generation of the database access component 3 that accesses the product table in the user database 101 regarding the product code, product name, body price, and tax amount of an arbitrary product will be described as an example.

【0014】本実施形態によるデータベースアクセスコ
ンポーネント3の自動生成装置には、図1に示すよう
に、システム開発者が各種データを入力する入力装置3
0と、入力データや自動生成されたデータ等を外部に表
示する表示装置20と、前記ユーザデータベース101
のスキーマ定義情報を格納するリポジトリ1と、前記リ
ポジトリ1と,システム開発者により予め作成されたテ
ンプレートファイル2とからデータベースアクセスコン
ポーネントのソースプログラム3を自動生成するデータ
ベースアクセスコンポーネント生成部10と、前記表示
装置20に表示されたスキーマ定義画面から前記入力装
置30により入力されたスキーマ定義情報を前記リポジ
トリ1に格納するスキーマ編集部40と、前記リポジト
リ1からスキーマ定義文5を自動生成するスキーマ定義
文生成部50と、が設けられている。尚、このスキーマ
定義文5はDDL(Data Description Language)によ
り作成されている。
As shown in FIG. 1, the automatic generation device of the database access component 3 according to the present embodiment has an input device 3 for inputting various data by a system developer.
0, a display device 20 for externally displaying input data, automatically generated data, and the like, and the user database 101.
1. A repository 1 for storing schema definition information of the database, a database access component generator 10 for automatically generating a source program 3 of a database access component from the repository 1 and a template file 2 created in advance by a system developer, and the display. A schema editing unit 40 for storing the schema definition information input by the input device 30 in the repository 1 from the schema definition screen displayed on the device 20, and a schema definition statement generation for automatically generating the schema definition statement 5 from the repository 1. And a section 50 are provided. The schema definition statement 5 is created in DDL (Data Description Language).

【0015】前記リポジトリ1に格納されるユーザデー
タベース101のスキーマ定義情報は、図3に示すよう
に、テーブル情報301とカラム情報302とから構成
される。前記テーブル情報301は、ユーザデータベー
ス101内の各テーブルに付与されたテーブルIDとテ
ーブル名に関するデータを有している。また、前記カラ
ム情報302は、当該カラムが属するテーブルに付与さ
れたテーブルID,当該カラムがテーブルの何番目のカ
ラムであるかを示す順序番号,当該カラムに付与された
カラム名,当該カラムに属するデータのデータタイプ,
当該カラムに属するデータの桁数,及び当該カラムが属
するテーブルにおける主キーに関する各データと、上記
各データ以外の属性データ(例えばデータベースの種類
等に関するデータ)と、を有している。
The schema definition information of the user database 101 stored in the repository 1 is composed of table information 301 and column information 302, as shown in FIG. The table information 301 has data relating to the table ID and table name given to each table in the user database 101. Also, the column information 302 belongs to the table that is assigned to the table to which the column belongs, the sequence number that indicates which column in the table the column is, the column name that is assigned to the column, and the column. Data type of data,
It has the number of digits of data belonging to the column, each data related to the primary key in the table to which the column belongs, and attribute data other than the above data (for example, data related to the type of database).

【0016】本実施形態では、一例として図3に示すよ
うに、テーブル情報301は、例えばテーブルIDが
「ABCDE」,テーブル名が「商品テーブル」となってい
る。また、カラム情報302においてはカラムによって
異なるが、カラム名が「商品コード」であるカラム情報
302aでは、例えばテーブルIDが「ABCDE」,順序
番号が「1」,カラム名が「商品コード」,データタイ
プが「文字型」,データの桁数が「8桁」,主キーが
「商品コード」となっている。また、カラム名が「商品
名」であるカラム情報302bでは、例えばテーブルI
Dが「ABCDE」,順序番号が「2」,カラム名が「商品
名」,データタイプが「文字型」,桁数が「20桁」,
主キーが「商品コード」となっている。同様に、カラム
名が「本体価格」であるカラム情報302cでは、例え
ばテーブルIDが「ABCDE」,順序番号が「3」,カラ
ム名が「本体価格」,データタイプが「数値型」,桁数
が「7桁」,主キーが「商品コード」となり、カラム名
が「税額」であるカラム情報302dでは、例えばテー
ブルIDが「ABCDE」,順序番号が「4」,カラム名が
「税額」,データタイプが「数値型」,桁数が「6
桁」,主キーが「商品コード」となっている。
In the present embodiment, as shown in FIG. 3 as an example, the table information 301 has, for example, a table ID "ABCDE" and a table name "product table". In the column information 302a whose column name is "product code" in the column information 302, which differs depending on the column, for example, the table ID is "ABCDE", the sequence number is "1", the column name is "product code", and the data is The type is "character type", the number of data digits is "8 digits", and the main key is "product code". Further, in the column information 302b whose column name is “product name”, for example, the table I
D is "ABCDE", sequence number is "2", column name is "product name", data type is "character type", number of digits is "20 digits",
The primary key is the "product code". Similarly, in the column information 302c in which the column name is "main price", for example, the table ID is "ABCDE", the sequence number is "3", the column name is "main price", the data type is "numerical value type", and the number of digits. Is "7 digits", the main key is "product code", and the column information 302d has a column name of "tax amount". For example, the table ID is "ABCDE", the sequence number is "4", the column name is "tax amount", The data type is "numeric type" and the number of digits is "6"
Digit "and the main key is" Product code ".

【0017】つまり、本実施形態の自動生成装置で自動
生成されたデータベースアクセスコンポーネントにより
アクセスされる商品テーブルにおいて、主キーは商品コ
ードであり、商品名,本体価格,税額は主キーに従属す
る項目となっている。
That is, in the product table accessed by the database access component automatically generated by the automatic generation device of the present embodiment, the primary key is the product code, and the product name, body price, and tax amount are items subordinate to the primary key. Has become.

【0018】また、システム開発者により予め作成され
る前記テンプレートファイル2は、テキスト形式のファ
イルであり、データアクセスコンポーネントの4種類の
主要なメソッド(参照,追加,更新,削除)に対する処
理を定義するものである。以下、これら4種類の主要メ
ソッドについて説明する。
The template file 2 created in advance by the system developer is a file in text format, and defines processing for four main methods (reference, addition, update, deletion) of the data access component. It is a thing. Hereinafter, these four types of main methods will be described.

【0019】まず参照メソッドは、引数に当該テーブル
の主キーに対するデータを指定するものであり、引数に
指定されたデータと一致するレコードをユーザデータベ
ース101より検索し、検索されたレコード群を戻り値
として返すものである。次に追加メソッドは、引数に当
該テーブルの各カラムのデータを指定するものであり、
指定されたデータをユーザデータベース101に1レコ
ード追加登録するものである。また更新メソッドは、追
加メソッドと同様に、引数に当該テーブルの各カラムの
データを指定するものであり、主キーと一致するレコー
ドを検索し、そのレコードに対して、引数で指定された
データで更新処理を行うものである。また削除メソッド
は、参照メソッドと同様に、引数に当該テーブルの主キ
ーに対するデータを指定するものであり、引数に指定さ
れたデータを持つレコードをユーザデータベース101
から削除するものである。
First, the reference method specifies the data for the primary key of the table as an argument, searches the user database 101 for a record that matches the data specified as the argument, and returns the searched record group as a return value. Is to be returned as. Next, the additional method specifies the data of each column of the table as an argument,
One record of the specified data is additionally registered in the user database 101. The update method, like the add method, specifies the data in each column of the table in the argument, searches for the record that matches the primary key, and uses the data specified in the argument for that record. Update processing is performed. The delete method, like the reference method, specifies the data for the primary key of the table as an argument, and records the data having the data specified as the argument in the user database 101.
Is to be deleted from.

【0020】以上のような4種類の主要なメソッドに対
する処理を定義するテンプレートファイル2の記述形式
は、プログラミング言語やデータベースアクセス方法に
よって異なるが、何れの記述形式においても、本実施形
態のテンプレートファイル内には、仮記号が用いられて
いる。本実施形態では、一例として図4に示すように、
テンプレートファイル内の仮記号として、@key(40
1)及び@list(402)という文字列を一例として用
いている。これらの仮記号は、データアクセスコンポー
ネント生成部10がリポジトリ1のスキーマ定義情報を
参照し、テーブル名やカラム名等に置換するために用い
られるものである。具体的には、@key(401)は当該
テーブルの主キーのカラム名に置換し、@list(40
2)は当該テーブル内の全てのカラム名をカンマで連結
した文字列に置換するものとしている。また、@table
(403)は当該テーブルのテーブル名に置換するもの
としている。このように仮記号を機能させることによ
り、上記商品テーブルの場合では、自動生成されるデー
タアクセスコンポーネント3において、後述の如く、@k
ey(401)は「商品コード」に、@list(402)は
「商品コード,商品名,本体価格,税額」という文字列
に、@table(403)は「商品テーブル」にそれぞれ置
換されることとなる。
The description format of the template file 2 that defines the processing for the four main methods as described above differs depending on the programming language and the database access method. Is a tentative symbol. In the present embodiment, as an example, as shown in FIG.
As a temporary symbol in the template file, @key (40
The character strings 1) and @list (402) are used as an example. These temporary symbols are used by the data access component generation unit 10 to refer to the schema definition information of the repository 1 and replace it with a table name, a column name, or the like. Specifically, @key (401) is replaced with the column name of the primary key of the table, and @list (40
In 2), all the column names in the table are replaced with a character string that is connected with a comma. Also, @table
(403) is to be replaced with the table name of the table. As described above, in the case of the above-described product table, the data access component 3 automatically generated by operating the temporary symbol in this way, as described later,
ey (401) should be replaced with "product code", @list (402) should be replaced with the character string "product code, product name, body price, tax amount", and @table (403) should be replaced with "product table". Becomes

【0021】以上のユーザデータベース101のスキー
マ定義情報と前記テンプレートファイル2とに基づき、
データベースアクセスコンポーネント生成部10におい
て、図5のようなデータアクセスコンポーネント3が自
動生成される。ここで、図5(a)は上記商品テーブル
にアクセスするデータベースアクセスコンポーネントの
一例であり、図5(b)は、自動生成されたデータベー
スアクセスコンポーネントのソースプログラムである。
尚、本実施形態では、商品テーブルにアクセスするデー
タベースアクセスコンポーネントにおけるクラス名を
「商品_アクセスクラス」としている。
Based on the above schema definition information of the user database 101 and the template file 2,
The database access component generator 10 automatically generates the data access component 3 as shown in FIG. Here, FIG. 5A is an example of a database access component for accessing the product table, and FIG. 5B is a source program of the automatically generated database access component.
In this embodiment, the class name in the database access component that accesses the product table is “product_access class”.

【0022】<データアクセスコンポーネント自動生成
処理手順>以下、データベースアクセスコンポーネント
生成部10において、図5のようなデータアクセスコン
ポーネント3が自動生成される処理手順を、図6を参照
して説明する。図6はデータアクセスコンポーネント生
成部10によるデータアクセスコンポーネント3の自動
生成処理手順を説明したフローチャートである。
<Data Access Component Automatic Generation Processing Procedure> The processing procedure of automatically generating the data access component 3 as shown in FIG. 5 in the database access component generation unit 10 will be described below with reference to FIG. FIG. 6 is a flowchart for explaining the automatic generation processing procedure of the data access component 3 by the data access component generation unit 10.

【0023】まず、データアクセスコンポーネント生成
部10は、テンプレートファイル2のレコードを1件分
読み(ステップS01)、読み込んだテンプレートファ
イルがEOF(End Of File)であるか否かを判定する
(ステップS02)。判定の結果、読み込んだテンプレ
ートファイルがEOFであれば本処理を終了する。
First, the data access component generator 10 reads one record of the template file 2 (step S01) and determines whether the read template file is EOF (End Of File) (step S02). ). As a result of the determination, if the read template file is EOF, this process ends.

【0024】一方、ステップS02において、読み込ん
だテンプレートファイルがEOFでない場合には、デー
タアクセスコンポーネント生成部10は、さらに、読み
込んだレコード中に仮記号401〜403が含まれてい
るか否か判定する(ステップS03)。ここで、仮記号
401〜403が含まれていると判定された場合、リポ
ジトリ1内の前記テーブル情報301,カラム情報30
2を検索してテーブル名及びカラム名を取得し、仮記号
の文字列置換を行う(ステップS04)。このステップ
S04において、含まれる仮記号が@key(401)であ
れば当該テーブルの主キー(本例では「商品コード」)
に置換され、@list(402)であれば当該テーブル内
の全てのカラム名をカンマで連結した文字列(本例では
「商品コード,商品名,本体価格,税額」)に置換され
る。また、含まれる仮記号が@table(403)であれば
当該テーブルのテーブル名(本例では「商品テーブ
ル」)に置換される。そして、置換後の文字列をデータ
フクセスコンポーネントのソースプログラム3として1
レコード出力する(ステップS05)。また、ステップ
S03において、仮記号が含まれていないと判定された
場合には、読み込んだレコードをデータアクセスコンポ
ーネントのソースプログラム3として1レコード出力す
る(ステップS05)。
On the other hand, in step S02, when the read template file is not EOF, the data access component generation unit 10 further determines whether or not the read record includes the temporary symbols 401 to 403 ( Step S03). Here, when it is determined that the temporary symbols 401 to 403 are included, the table information 301 and the column information 30 in the repository 1 are included.
2 is retrieved to acquire the table name and the column name, and the temporary character string is replaced (step S04). In step S04, if the included temporary symbol is @key (401), the primary key of the table (“product code” in this example)
If @list (402), all the column names in the table are replaced by a character string (in this example, "product code, product name, body price, tax amount"). If the included tentative symbol is @table (403), it is replaced with the table name (“product table” in this example) of the table. Then, the replaced character string is used as the source program 3 of the data access component 1
A record is output (step S05). If it is determined in step S03 that the temporary symbol is not included, one record is output as the read record as the source program 3 of the data access component (step S05).

【0025】ステップS05終了後に、ステップS01
の処理が再度行われ、ステップS02の処理において、
読み込んだテンプレートファイルがEOFであると判定
されるまで、各処理工程が図6に従って順次繰り返され
る。
After step S05 ends, step S01
Processing is performed again, and in the processing of step S02,
Each processing step is sequentially repeated according to FIG. 6 until it is determined that the read template file is EOF.

【0026】以上のようにして、データベースアクセス
コンポーネント生成部10において、リポジトリ1に格
納されたスキーマ定義情報とテンプレートファイル2と
から、システム開発者の手作業によらず、上述の4つの
メソッドを持つ図5のようなデータアクセスコンポーネ
ントのソースプログラム3が自動生成される。
As described above, the database access component generator 10 has the above-mentioned four methods from the schema definition information stored in the repository 1 and the template file 2 without manual work by the system developer. The source program 3 of the data access component as shown in FIG. 5 is automatically generated.

【0027】尚、上記の自動生成装置に、図7の如く、
リポジトリ1内に格納されたスキーマ定義情報からスキ
ーマ定義書4を自動作成するスキーマ定義書作成部70
を設けてもよい。このスキーマ定義書作成部70を設け
ることにより、データベースのテーブルスキーマの定義
書が自動的に作成され、ソースプログラムとドキュメン
トの整合性を確保し、テーブルスキーマ変更時の保守作
業の効率化を図ることが可能となり、保守性の向上を実
現できる。
In addition, as shown in FIG.
Schema definition document creation unit 70 for automatically creating the schema definition document 4 from the schema definition information stored in the repository 1
May be provided. By providing the schema definition creating unit 70, the definition of the table schema of the database is automatically created, the consistency between the source program and the document is ensured, and the efficiency of maintenance work when the table schema is changed is improved. This makes it possible to improve maintainability.

【0028】また、スキーマ編集部40及びスキーマ定
義文生成部50について公知技術(ツール)を利用する
場合にも対応できるように、図7の如く、既知ツールと
連携し,既知ツールのリポジトリ6を前記リポジトリ1
に一括して取り組むための他ツール連携部60を設けて
もよい。この場合、例えば他ツール連携部60におい
て、既知ツールのリポジトリ6の独自フォーマットをC
SV(Comma SeparatedValue)形式に変換し、しかる後
に本自動生成装置のリポジトリ1のフォーマットに再変
換する処理が行われるようにすることで、既知ツールの
リポジトリ6を前記リポジトリ1に一括して取り組むこ
とが可能となる。尚、この既知ツールのリポジトリ6を
前記リポジトリ1に一括して取り組む方法は、上記の方
法に限ったことではない。
Further, as shown in FIG. 7, the known tool repository 6 is linked with a known tool so that the known technology (tool) can be used for the schema editing section 40 and the schema definition statement generating section 50. The repository 1
Other tool cooperation unit 60 may be provided for collectively tackling the above. In this case, for example, in the other tool cooperation unit 60, the unique format of the repository 6 of known tools is changed to C
Converting to the SV (Comma Separated Value) format, and then performing the process of re-converting to the format of the repository 1 of this automatic generation device, thereby tackling the repository 6 of known tools in the repository 1 collectively. Is possible. Incidentally, the method of collectively handling the repository 6 of known tools in the repository 1 is not limited to the above method.

【0029】また、これまではデータアクセスコンポー
ネントのソースプログラムを自動生成できる自動生成装
置及び自動生成方法について説明したが、この自動生成
処理を容易にする手段としては、上記の自動生成装置に
限ったことではなく、本発明の自動生成処理を行うプロ
グラムを作成し、このプログラムに基づいてコンピュー
タに自動生成処理動作を実行させるようにしてもよい。
Further, the automatic generation device and the automatic generation method capable of automatically generating the source program of the data access component have been described so far, but the means for facilitating the automatic generation processing is limited to the above automatic generation device. Instead of this, a program for performing the automatic generation processing of the present invention may be created, and the computer may be caused to execute the automatic generation processing operation based on this program.

【0030】[0030]

【発明の効果】以上述べたように、本発明によれば、多
階層アーキテクチャに基づいたクライアント/サーバシ
ステムの開発におけるデータベースアクセスコンポーネ
ントのソースプログラムを自動生成し、プログラム開発
の生産性及び保守性を向上することができる。また、デ
ータベースのテーブルスキーマの定義書も自動作成する
ことにより、ソースプログラムとドキュメントの整合性
の確保し、テーブルスキーマ変更時の保守作業の効率
化,つまり保守性の向上を図ることが可能となる。更
に、テーブルスキーマを効率的に定義する複数の公知技
術との連携容易性を確保することもできる。
As described above, according to the present invention, the source program of the database access component in the development of the client / server system based on the multi-layer architecture is automatically generated to improve the productivity and maintainability of the program development. Can be improved. Also, by automatically creating the definition document of the table schema of the database, it is possible to ensure the consistency between the source program and the document, and to improve the efficiency of maintenance work when changing the table schema, that is, the maintainability. . Further, it is possible to ensure the easiness of cooperation with a plurality of known technologies that efficiently define the table schema.

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

【図1】本発明の一実施形態によるデータアクセスコン
ポーネント生成装置の概略構成図である。
FIG. 1 is a schematic configuration diagram of a data access component generation device according to an embodiment of the present invention.

【図2】クライアント/サーバシステムの多階層アーキ
テクチャの一例を示す図である。
FIG. 2 is a diagram illustrating an example of a multi-tiered architecture of a client / server system.

【図3】図1におけるリポジトリに格納されるスキーマ
定義情報の一例を示す図である。
3 is a diagram showing an example of schema definition information stored in a repository shown in FIG.

【図4】図1におけるテンプレートファイルの構成の一
例を示す図である。
FIG. 4 is a diagram showing an example of a configuration of a template file in FIG.

【図5】図1におけるデータアクセスコンポーネントの
構成の一例を示す図であり、図5(a)は商品テーブル
にアクセスするデータベースアクセスコンポーネントの
一例を,図5(b)は自動生成されたデータベースアク
セスコンポーネントのソースプログラムを説明するため
の図である。
5 is a diagram showing an example of a configuration of a data access component in FIG. 1, FIG. 5 (a) is an example of a database access component for accessing a product table, and FIG. 5 (b) is an automatically generated database access. It is a figure for demonstrating the source program of a component.

【図6】本発明のデータアクセスコンポーネント生成装
置における自動生成処理手順を示すフローチャートであ
る。
FIG. 6 is a flowchart showing an automatic generation processing procedure in the data access component generation device of the present invention.

【図7】本発明の他の実施形態によるデータアクセスコ
ンポーネント生成装置の概略構成図である。
FIG. 7 is a schematic configuration diagram of a data access component generation device according to another embodiment of the present invention.

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

1…リポジトリ、2…テンプレートファイル、3…デー
タベースアクセスコンポーネント(DBアクセスコンポ
ーネント)、5…スキーマ定義文(DDL文)、10…
データベースアクセスコンポーネント(DBアクセスコ
ンポーネント)生成部、20…表示装置、30…入力装
置、40…スキーマ編集部、50…スキーマ定義文生成
部。
1 ... Repository, 2 ... Template file, 3 ... Database access component (DB access component), 5 ... Schema definition statement (DDL statement), 10 ...
Database access component (DB access component) generation unit, 20 ... Display device, 30 ... Input device, 40 ... Schema editing unit, 50 ... Schema definition statement generation unit.

Claims (9)

【特許請求の範囲】[Claims] 【請求項1】 システム開発者が各種データを入力する
入力装置と、 入力データや自動生成されたデータ等を外部に表示する
表示装置と、 ユーザデータベースのスキーマ定義情報を格納するリポ
ジトリと、 前記表示装置に表示されたスキーマ定義画面から前記入
力装置により入力されたスキーマ定義情報を前記リポジ
トリに格納するスキーマ編集部と、 前記リポジトリと,システム開発者により予め作成され
たテンプレートファイルとからデータベースアクセスコ
ンポーネントのソースプログラムを自動生成するデータ
ベースアクセスコンポーネント生成部と、 を具備することを特徴とするデータベースアクセスコン
ポーネントの自動生成装置。
1. An input device for a system developer to input various data, a display device for externally displaying input data, automatically generated data, etc., a repository for storing schema definition information of a user database, and the display. From the schema definition screen displayed on the device, a schema editing unit that stores the schema definition information input by the input device in the repository, a database access component of the repository and a template file created in advance by a system developer. An automatic database access component generation device comprising: a database access component generation unit that automatically generates a source program.
【請求項2】 前記データベースアクセスコンポーネン
ト生成部は、 読み込んだテンプレートファイルの一件分のレコード中
に仮記号が含まれているか否か判定する判定機能と、 前記判定機能により仮記号が含まれていると判定された
場合、リポジトリ内のスキーマ定義情報からテーブル名
あるいはカラム名を取得し、レコード内の仮記号と,当
該仮記号に対応する文字列との置換処理を行う置換機能
と、 置換処理後の文字列を含む一件分のレコードをデータフ
クセスコンポーネントのソースプログラムとして1レコ
ード出力する出力機能と、 を備えることを特徴とする請求項1に記載のデータベー
スアクセスコンポーネントの自動生成装置。
2. The database access component generation unit includes a determination function of determining whether or not a record for one template file that has been read includes a temporary symbol, and the determination function includes a temporary symbol. If it is determined that the table name or column name is obtained from the schema definition information in the repository, the replacement function that replaces the temporary symbol in the record with the character string corresponding to the temporary symbol, and the replacement process The database access component automatic generation device according to claim 1, further comprising: an output function of outputting one record including a subsequent character string as a source program of the data access component.
【請求項3】 前記データベースアクセスコンポーネン
ト生成部は、 前記判定機能にて仮記号が含まれていないと判定された
場合には、前記判定後に、読み込んだ一件分のレコード
をデータアクセスコンポーネントのソースプログラムと
してそのまま1レコード出力する機能を備えることを特
徴とする請求項1又は2に記載のデータベースアクセス
コンポーネントの自動生成装置。
3. The database access component generation unit, when the determination function determines that no tentative symbol is included, outputs the one record read after the determination as the source of the data access component. 3. The database access component automatic generation device according to claim 1, further comprising a function of directly outputting one record as a program.
【請求項4】 前記リポジトリ内に格納されたスキーマ
定義情報からスキーマ定義書を自動作成するスキーマ定
義書作成部が更に設けられることを特徴とする請求項1
から3の内の何れかに記載のデータベースアクセスコン
ポーネントの自動生成装置。
4. The schema definition document creating section for automatically creating a schema definition document from the schema definition information stored in the repository is further provided.
5. An automatic generation device for database access component according to any one of 3 to 3.
【請求項5】 既知ツールのリポジトリを前記リポジト
リに一括して取り組むために既知ツールと連携する他ツ
ール連携部が更に設けられることを特徴とする請求項1
から4の内の何れかに記載のデータベースアクセスコン
ポーネントの自動生成装置
5. The other tool cooperation unit, which cooperates with a known tool to collectively work a repository of known tools on the repository, is further provided.
Automatic generation device of database access component according to any one of
【請求項6】 読み込んだテンプレートファイルの一件
分のレコード中に仮記号が含まれているか否か判定する
判定工程と、 前記判定工程にて仮記号が含まれていると判定された場
合、リポジトリ内のスキーマ定義情報からテーブル名あ
るいはカラム名を取得して、レコード内の仮記号と,当
該仮記号に対応する文字列との置換処理を行う置換工程
と、 置換後の文字列を含む一件分のレコードをデータフクセ
スコンポーネントのソースプログラムとして1レコード
出力する出力工程と、 を有することを特徴とするデータベースアクセスコンポ
ーネントの自動生成方法。
6. A determination step of determining whether or not a tentative symbol is included in one record of the read template file, and a case of determining that the tentative symbol is included in the determination step, A replacement process that acquires the table name or column name from the schema definition information in the repository and replaces the temporary symbol in the record with the character string corresponding to the temporary symbol, and a replacement process that includes the replaced character string. An automatic generation method of a database access component, comprising: an output step of outputting one record as a source program of a data access component.
【請求項7】 前記判定工程にて仮記号が含まれていな
いと判定された場合には、前記判定工程後に、読み込ん
だ一件分のレコードをデータアクセスコンポーネントの
ソースプログラムとして1レコード出力する工程が行わ
れることを特徴とする請求項6に記載のデータベースア
クセスコンポーネントの自動生成方法。
7. A step of outputting one read record as a source program of a data access component after the determining step when it is determined in the determining step that no temporary symbol is included. The method for automatically generating a database access component according to claim 6, wherein:
【請求項8】 コンピュータに 読み込んだテンプレートファイルの一件分のレコード中
に仮記号が含まれているか否か判定する判定機能と、 前記判定機能にて仮記号が含まれていると判定された場
合、リポジトリ内のスキーマ定義情報からテーブル名あ
るいはカラム名を取得して、レコード内の仮記号と,当
該仮記号に対応する文字列との置換処理を行う置換機能
と、 置換後の文字列を含む一件分のレコードをデータフクセ
スコンポーネントのソースプログラムとして1レコード
出力する出力機能と、 を実現させることを特徴とするデータベースアクセスコ
ンポーネントの自動生成プログラム。
8. A determination function for determining whether or not a temporary symbol is included in one record of a template file read into a computer, and the determination function determines that the temporary symbol is included. In this case, the table name or column name is obtained from the schema definition information in the repository, and the replacement function that replaces the temporary symbol in the record with the character string corresponding to that temporary symbol, and the replacement character string An output function that outputs one record including one record as a source program of the data access component, and an automatic generation program of the database access component that realizes
【請求項9】 前記判定機能にて仮記号が含まれていな
いと判定された場合には、前記判定後に、読み込んだ一
件分のレコードをデータアクセスコンポーネントのソー
スプログラムとして1レコード出力する機能を実現させ
ることを特徴とする請求項8に記載のデータベースアク
セスコンポーネントの自動生成プログラム。
9. When the determination function determines that no tentative symbol is included, after the determination, a function of outputting one read record as a source program of the data access component is provided. 9. The database access component automatic generation program according to claim 8, which is realized.
JP2001390323A 2001-12-21 2001-12-21 Automatic generation device, automatic generation method and automatic generation program for database access component Pending JP2003186670A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2001390323A JP2003186670A (en) 2001-12-21 2001-12-21 Automatic generation device, automatic generation method and automatic generation program for database access component

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2001390323A JP2003186670A (en) 2001-12-21 2001-12-21 Automatic generation device, automatic generation method and automatic generation program for database access component

Publications (1)

Publication Number Publication Date
JP2003186670A true JP2003186670A (en) 2003-07-04

Family

ID=27598288

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2001390323A Pending JP2003186670A (en) 2001-12-21 2001-12-21 Automatic generation device, automatic generation method and automatic generation program for database access component

Country Status (1)

Country Link
JP (1) JP2003186670A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006268124A (en) * 2005-03-22 2006-10-05 Fuji Electric Systems Co Ltd Automatic creation system and program
JP2007536607A (en) * 2004-02-27 2007-12-13 イープラス キャピタル、インコーポレイテッド System and method for user creation and command of rich content lifecycle
JP2010079803A (en) * 2008-09-29 2010-04-08 Fujitsu Broad Solution & Consulting Inc Software development support program, software development support device and software development support method
WO2013090067A1 (en) * 2011-12-15 2013-06-20 Microsoft Corporation Intelligently recommending schemas based on user input

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007536607A (en) * 2004-02-27 2007-12-13 イープラス キャピタル、インコーポレイテッド System and method for user creation and command of rich content lifecycle
JP2006268124A (en) * 2005-03-22 2006-10-05 Fuji Electric Systems Co Ltd Automatic creation system and program
JP2010079803A (en) * 2008-09-29 2010-04-08 Fujitsu Broad Solution & Consulting Inc Software development support program, software development support device and software development support method
WO2013090067A1 (en) * 2011-12-15 2013-06-20 Microsoft Corporation Intelligently recommending schemas based on user input

Similar Documents

Publication Publication Date Title
JP4010516B2 (en) Conversion rule derivation system
JPH0855019A (en) Visual programming method
JP2001060150A (en) Automatic data processing program generation system, method therefor and computer readable recording medium
JP5675676B2 (en) Business analysis design support device, business analysis design support method, and business analysis design support program
JP3227066B2 (en) Program generation method using program parts
JP5747698B2 (en) Requirements management support device
JPH1125126A (en) System design tool and dataware house design system and method
JP2003186670A (en) Automatic generation device, automatic generation method and automatic generation program for database access component
JP2003150762A (en) Cooperation method for project information and its system
JP7279524B2 (en) Data management program, data management method and data management system
JPH10154090A (en) Data management system
JP4117110B2 (en) Electronic form program creation system, electronic form program creation method, and electronic form program creation program
JP4693807B2 (en) Program development support system, method and program
JP3824468B2 (en) Data management system
JP3424558B2 (en) Object management method
JP5820324B2 (en) Design support system, design support method and program
JP2005165476A (en) Facility data management system and method
JPH11203314A (en) Document number automatic numbering system
JP3337717B2 (en) Database processing device and database processing method
JP2010191628A (en) Data definition support system and method for relational database
JPH06290035A (en) Design supporting system for information processing system
JP2004110102A (en) Project management method and process definition device
JPH04365172A (en) Retrieving device
JPH0934696A (en) Design information management device
JPH11272524A (en) Data converter and storage medium

Legal Events

Date Code Title Description
A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20060606

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20061031