JP5237030B2 - Software development support program, software development support apparatus, and software development support method - Google Patents

Software development support program, software development support apparatus, and software development support method Download PDF

Info

Publication number
JP5237030B2
JP5237030B2 JP2008249924A JP2008249924A JP5237030B2 JP 5237030 B2 JP5237030 B2 JP 5237030B2 JP 2008249924 A JP2008249924 A JP 2008249924A JP 2008249924 A JP2008249924 A JP 2008249924A JP 5237030 B2 JP5237030 B2 JP 5237030B2
Authority
JP
Japan
Prior art keywords
class
information
file
data access
component
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
Application number
JP2008249924A
Other languages
Japanese (ja)
Other versions
JP2010079803A (en
Inventor
紀尋 渡井
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.)
Fujitsu Broad Solution and Consulting Inc
Original Assignee
Fujitsu Broad Solution and Consulting Inc
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 Fujitsu Broad Solution and Consulting Inc filed Critical Fujitsu Broad Solution and Consulting Inc
Priority to JP2008249924A priority Critical patent/JP5237030B2/en
Publication of JP2010079803A publication Critical patent/JP2010079803A/en
Application granted granted Critical
Publication of JP5237030B2 publication Critical patent/JP5237030B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本発明は、ソフトウェア開発支援プログラム、ソフトウェア開発支援装置およびソフトウェア開発支援方法に関し、特にデータベースにアクセスするソフトウェアの開発を支援するソフトウェア開発支援プログラム、ソフトウェア開発支援装置およびソフトウェア開発支援方法に関する。   The present invention relates to a software development support program, a software development support apparatus, and a software development support method, and more particularly to a software development support program, a software development support apparatus, and a software development support method that support the development of software that accesses a database.

現在、コンピュータシステムの大規模化や複雑化が進む一方、システム開発の低コスト化や短納期化が求められている。この点、システム開発を効率化するため、頻繁に出現するソフトウェアの機能を部品(コンポーネント)化して再利用性を高め、コンポーネントをシステム開発基盤として提供するという手法が考えられる。再利用性を高めるのに役立つ技術として、例えば、依存性注入(DI:Dependency Injection)やアスペクト指向プログラミング(AOP:Aspect Oriented Programming)などの技術がある。   Currently, computer systems are becoming larger and more complex, and there is a demand for lower system development costs and shorter delivery times. In this regard, in order to improve the efficiency of system development, a method of improving the reusability by converting frequently appearing software functions into components (components) and providing the components as a system development platform can be considered. Examples of techniques useful for enhancing reusability include techniques such as dependency injection (DI) and aspect oriented programming (AOP).

DIでは、コンテナと呼ばれるプログラム実行環境において、コンポーネント間の依存関係を実行時に注入することができる。これにより、個々のコンポーネントの独立性をより高めることができる。また、AOPでは、例外処理やログ出力など、システム内で横断的に利用される機能をコンポーネントとして切り出しておき、プログラム実行環境がこれら機能を事後的にシステムに付加することを可能にする。   In DI, dependency relationships between components can be injected at the time of execution in a program execution environment called a container. Thereby, the independence of each component can be improved more. In AOP, functions used across the system such as exception processing and log output are extracted as components, and the program execution environment can add these functions to the system afterwards.

このように、DIやAOPの技術を用いることで、コンポーネント間の依存関係を疎に保つことができ、コンポーネントの再利用性を高めることができる。このような再利用性の高いコンポーネントは、システム固有の業務ロジックから分離されたものであり、一定のパターン化が可能なものも多い。そこで、システム開発をより効率化する観点から、コンポーネントの作成を支援する方法が考えられている。例えば、データベースに登録されたテーブルにアクセスするためのデータアクセスオブジェクト(DAO:Data Access Object)を、データベースに関する情報から自動生成する技術がある(例えば、特許文献1,2参照)。
特開2006−268124号公報 特開2006−268126号公報
In this way, by using DI or AOP technology, the dependency between components can be kept sparse, and the reusability of components can be improved. Such highly reusable components are separated from the business logic unique to the system, and many of them can be formed into a certain pattern. Therefore, from the viewpoint of improving the efficiency of system development, a method for supporting the creation of components has been considered. For example, there is a technique for automatically generating a data access object (DAO: Data Access Object) for accessing a table registered in a database from information about the database (see, for example, Patent Documents 1 and 2).
JP 2006-268124 A JP 2006-268126 A

ここで、再利用性を高めたコンポーネントを他のプログラムから利用可能にするため、これらコンポーネントをプログラム実行環境に登録することになる。しかし、コンポーネントを実際に運用可能な状態にしてシステム開発基盤を用意する作業は、多大な工数を要するという問題がある。例えば、データベースのテーブル数が多いシステムでは、DAOを登録するための工数が大きな問題となる。また、ログ出力処理や例外処理などのシステム横断的な処理を組み込むための工数も問題となる。   Here, in order to make components with improved reusability available to other programs, these components are registered in the program execution environment. However, the task of preparing a system development infrastructure in a state where components can be actually operated has a problem that it requires a great amount of man-hours. For example, in a system with a large number of database tables, the man-hour for registering DAO becomes a big problem. In addition, man-hours for incorporating cross-system processing such as log output processing and exception processing are also a problem.

本発明はこのような点に鑑みてなされたものであり、効率的なシステム開発を支援するソフトウェア開発支援プログラム、ソフトウェア開発支援装置およびソフトウェア開発支援方法を提供することを目的とする。   The present invention has been made in view of the above, and an object thereof is to provide a software development support program, a software development support apparatus, and a software development support method that support efficient system development.

上記課題を解決するために、ソフトウェア開発支援プログラムが提供される。このソフトウェア開発支援プログラムを実行するコンピュータは、データアクセス部品生成手段、アプリケーション生成手段、共通部品記憶手段および登録情報生成手段を有する。データアクセス部品生成手段は、データベースに格納された複数のテーブルの情報に基づいて、複数のテーブルそれぞれについて、アクセス要求を受け付けて該当のテーブルに対し所定の操作を行うプログラム部品であるデータアクセス部品を生成する。アプリケーション生成手段は、データアクセス部品に対してアクセス要求を行うアプリケーションプログラムを生成する。共通部品記憶手段は、所定の操作に伴って実行させる複数のデータアクセス部品の間で共通の処理を定義した共通部品を記憶する。登録情報生成手段は、データアクセス部品生成手段が生成したデータアクセス部品をプログラム実行環境に登録するための情報と、共通部品記憶手段に記憶された共通部品で定義された処理がデータアクセス部品による所定の操作の際にプログラム実行環境上で実行されるようにするための情報と、アプリケーション生成手段が生成したアプリケーションプログラムをデータアクセス部品に関連付けてプログラム実行環境に登録するための情報とを含む登録情報を生成する。
In order to solve the above problems, a software development support program is provided. A computer that executes the software development support program includes data access component generation means, application generation means, common component storage means, and registration information generation means. The data access component generation unit is configured to obtain a data access component that is a program component that receives an access request and performs a predetermined operation on the corresponding table for each of the plurality of tables based on the information of the plurality of tables stored in the database. Generate. The application generation unit generates an application program that makes an access request to the data access component. The common component storage means stores a common component that defines a common process among a plurality of data access components to be executed in accordance with a predetermined operation. The registration information generation means includes information for registering the data access component generated by the data access component generation means in the program execution environment and a process defined by the common component stored in the common component storage means. Registration information including information for executing on the program execution environment during the operation and information for registering the application program generated by the application generation means in the program execution environment in association with the data access component Is generated.

また、上記課題を解決するために、上記ソフトウェア開発支援プログラムを実行するコンピュータと同様の機能を有するソフトウェア開発支援装置が提供される。また、上記ソフトウェア開発支援プログラムにより実現される処理と同様の処理を行うソフトウェア開発支援方法が提供される。   In order to solve the above problems, a software development support apparatus having the same function as a computer that executes the software development support program is provided. Also provided is a software development support method that performs the same processing as the processing realized by the software development support program.

上記ソフトウェア開発支援プログラム、ソフトウェア開発支援装置およびソフトウェア開発支援方法によれば、効率的なシステム開発を支援することができる。   According to the software development support program, software development support apparatus, and software development support method, efficient system development can be supported.

以下、本実施の形態を図面を参照して詳細に説明する。
図1は、本実施の形態の概要を示す図である。コンピュータ1は、データベース2に登録されたテーブルにアクセスするためのプログラム部品(例えば、DAOクラス)を自動生成する。コンピュータ1は、データアクセス部品生成手段1a、共通部品記憶手段1bおよび登録情報生成手段1cを有する。
Hereinafter, the present embodiment will be described in detail with reference to the drawings.
FIG. 1 is a diagram showing an outline of the present embodiment. The computer 1 automatically generates a program part (for example, DAO class) for accessing a table registered in the database 2. The computer 1 includes a data access component generation unit 1a, a common component storage unit 1b, and a registration information generation unit 1c.

データアクセス部品生成手段1aは、データベース2に格納されたテーブル2a,2b,2cの情報に基づいて、各テーブルそれぞれについて、アクセス要求を受け付けて該当のテーブルに対し所定の操作を行うプログラム部品であるデータアクセス部品4a,4b,4cを生成する。ここで、データアクセス部品生成手段1aは、例えば、データベース2に対する所定の接続情報に基づいてデータベース2に接続し、データベース2に登録されたテーブル2a,2b,2cそれぞれのテーブル情報を取得する。そして、取得したテーブル情報からデータアクセス部品4a,4b,4cを生成する。   The data access component generation unit 1a is a program component that receives an access request for each table and performs a predetermined operation on the corresponding table based on information in the tables 2a, 2b, and 2c stored in the database 2. Data access components 4a, 4b and 4c are generated. Here, the data access component generation unit 1a connects to the database 2 based on predetermined connection information with respect to the database 2, for example, and acquires table information of the tables 2a, 2b, and 2c registered in the database 2. Then, data access components 4a, 4b and 4c are generated from the acquired table information.

共通部品記憶手段1bは、所定の操作に伴って実行させるデータアクセス部品4a,4b,4cの間で共通の処理を定義した共通部品4dを記憶する。共通部品4dには、例えば、データベース2への接続処理、例外処理およびログ出力処理など、データアクセス部品4a,4b,4cの実行に必要となるコンポーネントが含まれる。   The common component storage unit 1b stores a common component 4d that defines a common process among the data access components 4a, 4b, and 4c to be executed in accordance with a predetermined operation. The common component 4d includes components necessary for execution of the data access components 4a, 4b, and 4c, such as connection processing to the database 2, exception processing, and log output processing.

登録情報生成手段1cは、データアクセス部品生成手段1aが生成したデータアクセス部品4a,4b,4cをプログラム実行環境4に登録するための情報と、共通部品記憶手段1bに記憶された共通部品4dで定義された処理がデータアクセス部品4a,4b,4cによる所定の操作の際にプログラム実行環境4上で実行されるようにするための情報とを含む登録情報3を生成する。   The registration information generating unit 1c includes information for registering the data access components 4a, 4b, and 4c generated by the data access component generating unit 1a in the program execution environment 4 and the common component 4d stored in the common component storage unit 1b. Registration information 3 including information for allowing the defined processing to be executed on the program execution environment 4 at the time of a predetermined operation by the data access components 4a, 4b, and 4c is generated.

プログラム実行環境4は、データアクセス部品4a,4b,4cおよび共通部品4dを実行する。プログラム実行環境4は、登録情報3に基づいてデータアクセス部品4a,4b,4cと共通部品4dとを関連付ける。プログラム実行環境4は、例えば、登録情報3に基づいてデータアクセス部品4a,4b,4cの実行前後に共通部品4dを呼び出して実行する。   The program execution environment 4 executes the data access components 4a, 4b, 4c and the common component 4d. The program execution environment 4 associates the data access components 4a, 4b, and 4c with the common component 4d based on the registration information 3. The program execution environment 4 calls and executes the common component 4d before and after the execution of the data access components 4a, 4b, and 4c based on the registration information 3, for example.

このようなコンピュータ1によれば、データベース2に格納されたテーブル2a,2b,2cの情報に基づいて、テーブル2a,2b,2cに対するデータアクセス部品4a,4b,4cが生成される。そして、プログラム実行環境4がデータアクセス部品4a,4b,4cを実行する際に、共通部品記憶手段1bに記憶された共通部品4dを実行するようデータアクセス部品4a,4b,4cをプログラム実行環境4に登録するための登録情報3が生成される。   According to such a computer 1, data access components 4a, 4b, and 4c for the tables 2a, 2b, and 2c are generated based on the information of the tables 2a, 2b, and 2c stored in the database 2. When the program execution environment 4 executes the data access components 4a, 4b, 4c, the data access components 4a, 4b, 4c are set to execute the common component 4d stored in the common component storage unit 1b. Registration information 3 is generated for registration in.

このため、データアクセス部品4a,4b,4cを共通部品4dと関連付けるためのコーディングや登録情報3の作成に要する工数が削減される。そして、データアクセス部品4a,4b,4cを共通部品4dと共に即座に動作可能な状態とすることができる。   For this reason, the man-hour required for coding for associating the data access components 4a, 4b, and 4c with the common component 4d and creation of the registration information 3 is reduced. Then, the data access components 4a, 4b, 4c can be immediately operated together with the common component 4d.

これにより、開発者は、システム固有の業務ロジックの開発に注力することが可能となり、システム開発作業を効率的に行うことができる。
なお、データアクセス部品生成手段1aは、データアクセス部品4a,4b,4cを利用するプログラム(例えば、サンプル用の簡易なプログラム)を更に生成してもよい。このようにすると、このプログラムによるデータアクセス部品4a,4b,4cを介したテーブル2a,2b,2cへのアクセスに関する動作確認を即座に開始することができるようになる。
As a result, the developer can focus on the development of business logic unique to the system, and can efficiently perform the system development work.
The data access component generation unit 1a may further generate a program that uses the data access components 4a, 4b, and 4c (for example, a simple program for sampling). In this way, it becomes possible to immediately start the operation confirmation regarding the access to the tables 2a, 2b, 2c via the data access components 4a, 4b, 4c by this program.

ところで、コンピュータ1は、オブジェクト指向言語によるシステム開発を行う際に特に有用となる。以下では、Java(登録商標)を用いたシステム開発を例に挙げて、本実施の形態を更に詳細に説明する。   Incidentally, the computer 1 is particularly useful when performing system development using an object-oriented language. In the following, this embodiment will be described in more detail by taking system development using Java (registered trademark) as an example.

[第1の実施の形態]
図2は、第1の実施の形態のコンピュータのハードウェア構成を示す図である。コンピュータ100は、システム開発において、システム基盤となるプログラムを自動生成する。コンピュータ100は、CPU(Central Processing Unit)101によって装置全体が制御されている。CPU101には、バス107を介してRAM(Random Access Memory)102、HDDインタフェース103、グラフィック処理装置104、入力インタフェース105および通信インタフェース106が接続されている。
[First Embodiment]
FIG. 2 is a diagram illustrating a hardware configuration of the computer according to the first embodiment. The computer 100 automatically generates a program serving as a system base in system development. The computer 100 is entirely controlled by a CPU (Central Processing Unit) 101. A random access memory (RAM) 102, an HDD interface 103, a graphic processing device 104, an input interface 105, and a communication interface 106 are connected to the CPU 101 via a bus 107.

RAM102には、CPU101に実行させるOS(Operating System)のプログラムやアプリケーションのプログラムの少なくとも一部が一時的に格納される。また、RAM102には、CPU101による処理に必要な各種データが格納される。   The RAM 102 temporarily stores at least part of an OS (Operating System) program and application programs to be executed by the CPU 101. The RAM 102 stores various data necessary for processing by the CPU 101.

HDD103は、データを記憶するためのディスク装置である。HDD103には、OSのプログラムやアプリケーションのプログラムが格納される。また、HDD103には、CPU101による処理に必要な各種データが格納される。   The HDD 103 is a disk device for storing data. The HDD 103 stores an OS program and application programs. The HDD 103 stores various data necessary for processing by the CPU 101.

グラフィック処理装置104には、モニタ11が接続されている。グラフィック処理装置104は、CPU101からの命令に従って、画像をモニタ11の画面に表示させる。入力インタフェース105には、キーボード12とマウス13とが接続されている。入力インタフェース105は、キーボード12やマウス13から送られてくる信号を、バス107を介してCPU101に送信する。   A monitor 11 is connected to the graphic processing device 104. The graphic processing device 104 displays an image on the screen of the monitor 11 in accordance with a command from the CPU 101. A keyboard 12 and a mouse 13 are connected to the input interface 105. The input interface 105 transmits a signal transmitted from the keyboard 12 or the mouse 13 to the CPU 101 via the bus 107.

通信インタフェース106は、ネットワーク10に接続されている。通信インタフェース106は、ネットワーク10を介してDB(DataBase)サーバ200と通信を行う。
コンピュータ100は、通信インタフェース106およびDBサーバ200を介してデータベース210にアクセスする。
The communication interface 106 is connected to the network 10. The communication interface 106 communicates with a DB (DataBase) server 200 via the network 10.
The computer 100 accesses the database 210 via the communication interface 106 and the DB server 200.

図3は、第1の実施の形態のコンピュータの機能を示す第1のブロック図である。コンピュータ100は、ORM(Object Relational Mapping)ファイル生成部110、ORMファイル記憶部115、ORMクラス生成部120、ORMクラス記憶部125、テンプレート記憶部130、DAOクラス生成部140、DAOクラス記憶部145、クエリ記述ファイル生成部150、クエリ記述ファイル記憶部155、共通部品記憶部160、コンテキストファイル生成部170、コンテキストファイル記憶部175、サンプルクラス生成部180およびサンプルクラス記憶部185を有する。   FIG. 3 is a first block diagram illustrating functions of the computer according to the first embodiment. The computer 100 includes an ORM (Object Relational Mapping) file generation unit 110, an ORM file storage unit 115, an ORM class generation unit 120, an ORM class storage unit 125, a template storage unit 130, a DAO class generation unit 140, a DAO class storage unit 145, It includes a query description file generation unit 150, a query description file storage unit 155, a common component storage unit 160, a context file generation unit 170, a context file storage unit 175, a sample class generation unit 180, and a sample class storage unit 185.

ORMファイル生成部110は、DB接続情報20とDBサーバ200を介して取得するデータベース210のテーブル構成とに基づいてORMを実行する。ここで、ORMとは、オブジェクト指向言語で扱う「オブジェクト」のデータと「リレーショナルデータベース(RDB:Relational DB)」のレコードとを対応付けることを示す。データベース210のテーブル構成を示す情報には、例えば、DDL(Data Definition Language)がある。ORMを行うことで、業務サービスを実行するクラスからデータベース210へのテーブルアクセスを行うために必要となるコーディング作業を軽減することができる。ORMファイル生成部110は、ORMにより生成したORMファイルをORMファイル記憶部115に格納する。ORMファイル生成部110の機能を実現するアプリケーションとして、例えば、Middlegenを用いることができる。   The ORM file generation unit 110 executes the ORM based on the DB connection information 20 and the table configuration of the database 210 acquired via the DB server 200. Here, ORM indicates that data of “object” handled in an object-oriented language is associated with a record of “relational database (RDB)”. The information indicating the table configuration of the database 210 includes, for example, DDL (Data Definition Language). By performing ORM, it is possible to reduce the coding work required to perform table access to the database 210 from the class that executes the business service. The ORM file generation unit 110 stores the ORM file generated by the ORM in the ORM file storage unit 115. For example, Middlegen can be used as an application for realizing the function of the ORM file generation unit 110.

ORMファイル記憶部115は、ORMファイル生成部110が生成したORMファイルを記憶する。
ORMクラス生成部120は、ORMファイル記憶部115に記憶されたORMファイルに基づいてORMクラスを生成する。ORMクラスは、ORMファイルに含まれるデータをカプセル化するためのクラスである。ORMクラス生成部120は、生成したORMクラスをORMクラス記憶部125に記憶する。ORMファイル生成部110の機能を実現するアプリケーションとして、例えば、Hibernateを用いることができる。
The ORM file storage unit 115 stores the ORM file generated by the ORM file generation unit 110.
The ORM class generation unit 120 generates an ORM class based on the ORM file stored in the ORM file storage unit 115. The ORM class is a class for encapsulating data included in the ORM file. The ORM class generation unit 120 stores the generated ORM class in the ORM class storage unit 125. As an application for realizing the function of the ORM file generation unit 110, for example, Hibernate can be used.

ORMクラス記憶部125は、ORMクラス生成部120が生成したORMクラスを記憶する。
テンプレート記憶部130は、DAOクラス生成部140、クエリ記述ファイル生成部150、コンテキストファイル生成部170およびサンプルクラス生成部180で自動生成されるプログラムのテンプレート(雛形)を記憶する。DAOクラス生成部140、クエリ記述ファイル生成部150、コンテキストファイル生成部170およびサンプルクラス生成部180は、テンプレートエンジンなどを使用してプログラムを自動生成する。テンプレートエンジンとしては、例えば、Velocityを用いることができる。
The ORM class storage unit 125 stores the ORM class generated by the ORM class generation unit 120.
The template storage unit 130 stores a template (model) of a program automatically generated by the DAO class generation unit 140, the query description file generation unit 150, the context file generation unit 170, and the sample class generation unit 180. The DAO class generation unit 140, the query description file generation unit 150, the context file generation unit 170, and the sample class generation unit 180 automatically generate a program using a template engine or the like. For example, Velocity can be used as the template engine.

DAOクラス生成部140は、ORMクラス記憶部125に記憶されたORMクラスとテンプレート記憶部130に記憶されたDAOクラス用テンプレートとに基づいてDAOクラスを生成する。DAOクラスは、業務サービスの要求に応じてORMクラスを介してデータベース210にアクセスするためのクラスである。DAOクラス生成部140は生成したDAOクラスをDAOクラス記憶部145に格納する。   The DAO class generation unit 140 generates a DAO class based on the ORM class stored in the ORM class storage unit 125 and the DAO class template stored in the template storage unit 130. The DAO class is a class for accessing the database 210 via the ORM class in response to a business service request. The DAO class generation unit 140 stores the generated DAO class in the DAO class storage unit 145.

DAOクラス記憶部145は、DAOクラス生成部140が生成したDAOクラスを記憶する。また、DAOクラス記憶部145は、汎用DAOクラスを記憶する。汎用DAOクラスは、DAOクラス生成部140が生成したDAOクラスにデータベース210のテーブルに対する基本的な操作を提供するクラスである。ここで、テーブルに対する基本的な操作とは、例えば、CRUD(Create / Read / Update / Delete)などの操作である。汎用DAOクラスに関しては、図17で詳述する。   The DAO class storage unit 145 stores the DAO class generated by the DAO class generation unit 140. The DAO class storage unit 145 stores general-purpose DAO classes. The general-purpose DAO class is a class that provides basic operations for the tables of the database 210 to the DAO class generated by the DAO class generation unit 140. Here, the basic operation on the table is, for example, an operation such as CRUD (Create / Read / Update / Delete). The general DAO class will be described in detail with reference to FIG.

クエリ記述ファイル生成部150は、DAOクラス記憶部145に記憶されたDAOクラスおよびテンプレート記憶部130に記憶されたクエリ記述用テンプレートに基づいてクエリ記述ファイルを生成する。クエリ記述ファイルには、汎用DAOクラスで提供されるテーブルの基本操作以外の操作、例えば、業務処理で要求される複雑なテーブル処理のクエリを設定することができる。クエリ記述ファイル生成部150は、生成したクエリ記述ファイルをクエリ記述ファイル記憶部155に格納する。   The query description file generation unit 150 generates a query description file based on the DAO class stored in the DAO class storage unit 145 and the query description template stored in the template storage unit 130. In the query description file, an operation other than the basic operation of the table provided by the general-purpose DAO class, for example, a complicated table processing query required for business processing can be set. The query description file generation unit 150 stores the generated query description file in the query description file storage unit 155.

クエリ記述ファイル記憶部155は、クエリ記述ファイル生成部150が生成したクエリ記述ファイルを記憶する。
共通部品記憶部160は、DAOクラス生成部140が生成したDAOクラスやサンプルクラス生成部180が生成したサービスの処理で共通的に利用されるコンポーネントを記憶する。このようなコンポーネントは、例えば、例外処理やログ出力などを行うコンポーネントである。また、データベース210とのコネクションを管理するコンポーネントやデータベース210に対するコミットやロールバックなどのトランザクションを管理するコンポーネントが含まれる。
The query description file storage unit 155 stores the query description file generated by the query description file generation unit 150.
The common part storage unit 160 stores DAO classes generated by the DAO class generation unit 140 and components commonly used in processing of services generated by the sample class generation unit 180. Such a component is, for example, a component that performs exception processing, log output, and the like. Further, a component for managing a connection with the database 210 and a component for managing a transaction such as commit or rollback for the database 210 are included.

コンテキストファイル生成部170は、テンプレート記憶部130に記憶されたコンテキスト用テンプレートに基づいて、DAOクラス記憶部145に記憶されたDAOクラスおよび共通部品記憶部160に記憶された共通コンポーネントを登録したコンテキストファイルを生成する。コンテキストファイルは、共通コンポーネントのクラスやDAOクラスおよび後述するサンプルクラスの関連付けを定義したファイルである。コンテキストファイル生成部170は、生成したコンテキストファイルをコンテキストファイル記憶部175に格納する。   The context file generation unit 170 registers the DAO class stored in the DAO class storage unit 145 and the common component stored in the common component storage unit 160 based on the context template stored in the template storage unit 130. Is generated. The context file is a file in which the association of the common component class, the DAO class, and a sample class to be described later is defined. The context file generation unit 170 stores the generated context file in the context file storage unit 175.

コンテキストファイル記憶部175は、コンテキストファイル生成部170が生成したコンテキストファイルを記憶する。
サンプルクラス生成部180は、DAOクラス記憶部145に記憶されたDAOクラスおよびテンプレート記憶部130に記憶されたサンプルクラス用テンプレートに基づいてDAOクラスを利用するサンプルのサービスであるサンプルクラスを生成する。サンプルクラス生成部180は、生成したサンプルクラスをサンプルクラス記憶部185に格納する。
The context file storage unit 175 stores the context file generated by the context file generation unit 170.
The sample class generation unit 180 generates a sample class that is a sample service that uses a DAO class based on the DAO class stored in the DAO class storage unit 145 and the sample class template stored in the template storage unit 130. The sample class generation unit 180 stores the generated sample class in the sample class storage unit 185.

サンプルクラス記憶部185は、サンプルクラス生成部180が生成したサンプルクラスを記憶する。
このように、コンピュータ100は、データベース210のテーブルにアクセスするために必要となる定義ファイル(ORMファイルやクエリ記述ファイル)、DAOクラスおよびサンプルクラスを順次生成する。
The sample class storage unit 185 stores the sample class generated by the sample class generation unit 180.
As described above, the computer 100 sequentially generates a definition file (ORM file or query description file), a DAO class, and a sample class necessary for accessing the table of the database 210.

次に、生成されたクラスに基づいてサービスを実行する構成に関して説明する。
図4は、第1の実施の形態のコンピュータの機能を示す第2のブロック図である。コンピュータ100は、図3で示した構成に加えて、配置部190および実行部195を有する。
Next, a configuration for executing a service based on the generated class will be described.
FIG. 4 is a second block diagram illustrating functions of the computer according to the first embodiment. The computer 100 includes an arrangement unit 190 and an execution unit 195 in addition to the configuration shown in FIG.

配置部190は、コンテキストファイル記憶部175に記憶されたコンテキストファイルに基づき、ORMクラス記憶部125に記憶されたORMクラス、DAOクラス記憶部145に記憶されたDAOクラス、汎用DAOクラスおよびサンプルクラス記憶部185に記憶されたサンプルクラスをメモリ上に配置する。このとき、配置部190は、各クラスで必要となる定義ファイル(ORMファイルやクエリ記述ファイル)を読み込む。更に、共通部品記憶部160に記憶された共通コンポーネントのクラスをメモリ上に配置する。   The placement unit 190 stores the ORM class stored in the ORM class storage unit 125, the DAO class stored in the DAO class storage unit 145, the general DAO class, and the sample class based on the context file stored in the context file storage unit 175. The sample class stored in the unit 185 is arranged on the memory. At this time, the arrangement unit 190 reads definition files (ORM file and query description file) necessary for each class. Furthermore, the common component classes stored in the common component storage unit 160 are arranged on the memory.

実行部195は、コンテキストファイルに基づき、メモリ上に配置された各クラスを関連付けてサービスを実行する。実行部195は、いわゆるコンテナである。
配置部190および実行部195の機能は、例えば、DIやAOPの手法を組み込んだSpring Frameworkと呼ばれるフレームワークを用いて実現することができる。以下では、配置部190や実行部195の機能をSpring Frameworkを用いて実現することを想定とした例を示す。
The execution unit 195 executes the service by associating each class arranged on the memory based on the context file. The execution unit 195 is a so-called container.
The functions of the placement unit 190 and the execution unit 195 can be realized using, for example, a framework called Spring Framework that incorporates a DI or AOP technique. In the following, an example is assumed on the assumption that the functions of the placement unit 190 and the execution unit 195 are realized using Spring Framework.

図5は、DB接続情報の例を示す図である。DB接続情報20には、ドライバクラス21、DB接続先情報22、DB接続ユーザ名23、パスワード24、マッピング対象テーブル25,26が設定されている。   FIG. 5 is a diagram illustrating an example of DB connection information. In the DB connection information 20, a driver class 21, DB connection destination information 22, a DB connection user name 23, a password 24, and mapping target tables 25 and 26 are set.

ドライバクラス21には、データベース210へのアクセスに用いるJDBCドライバクラスを指定する情報(例えば、“com.mysql.jdbc.Driver”)が設定される。
DB接続先情報22には、DBサーバ200を示す接続先情報(例えば、“jdbc:mysql://database/testdb”)が設定される。
The driver class 21 is set with information (for example, “com.mysql.jdbc.Driver”) that specifies the JDBC driver class used for accessing the database 210.
In the DB connection destination information 22, connection destination information (for example, “jdbc: mysql: // database / testdb”) indicating the DB server 200 is set.

DB接続ユーザ名23には、データベース210へのアクセスに用いるユーザ名を指定する情報(例えば、“jim”)が設定される。
パスワード24は、DB接続ユーザ名23に対応するパスワードを示す情報(例えば、“0123”)が設定される。
In the DB connection user name 23, information (for example, “jim”) for specifying a user name used for accessing the database 210 is set.
In the password 24, information (for example, “0123”) indicating a password corresponding to the DB connection user name 23 is set.

マッピング対象テーブル25,26には、ORMファイル生成部110によるORMの実行対象となるテーブル名(例えば、“Grouptbl”や“Ikisakitbl”)が設定される。
ORMファイル生成部110は、DB接続情報20に基づいて、データベース210にアクセスし、ORMを実行する。
In the mapping target tables 25 and 26, a table name (for example, “Grouptbl” or “Ikisakitbl”) to be executed by the ORM file generating unit 110 is set.
Based on the DB connection information 20, the ORM file generation unit 110 accesses the database 210 and executes ORM.

なお、DB接続情報20には、上記で説明した情報以外の情報を含んでいてもよい。例えば、データベースのスキーマ情報や接続先データベースのSQL方言(Dialect)を示す情報を含んでいてもよい。   The DB connection information 20 may include information other than the information described above. For example, information indicating the schema information of the database or the SQL dialect (Dialect) of the connection destination database may be included.

図6は、データベースに格納されるテーブル構造の例を示す図である。テーブル211は、データベース210に格納される“Grouptbl”テーブルの構造を示している。テーブル211には、カラム名、データ型、制約および主キーを示す項目が示されている。各項目の横方向に並べられた情報同士が互いに関連付けられて、1つのカラムについての属性情報を構成する。   FIG. 6 is a diagram illustrating an example of a table structure stored in the database. The table 211 shows the structure of the “Grouptbl” table stored in the database 210. The table 211 shows items indicating column names, data types, constraints, and primary keys. Information arranged in the horizontal direction of each item is associated with each other to form attribute information for one column.

カラム名を示す項目には、カラムの名称を示す情報が設定される。データ型を示す項目には、登録するデータの型を示す情報が設定される。制約を示す項目には、登録するデータを制御する情報が設定される。主キーを示す項目には、該当のカラムがテーブル211の主キーであるか否かを示す情報が設定される。   In the item indicating the column name, information indicating the column name is set. In the item indicating the data type, information indicating the type of data to be registered is set. Information for controlling data to be registered is set in the item indicating restriction. In the item indicating the primary key, information indicating whether or not the corresponding column is the primary key of the table 211 is set.

テーブル211には、例えば、カラム名が“GRCD”、データ型が“varchar(8)”、制約が“NOT NULL”、主キーが“○”という情報が設定される。これは、カラム名“GRCD”には、可変長文字型8桁で非“NULL”であるデータを登録可能であり、“GRCD”は主キーであることを示している。なお、主キーではないカラムである“GRNAME”や“USERID”の主キーの項目には、“−(ハイフン)”が設定されている。   In the table 211, for example, information that the column name is “GRCD”, the data type is “varchar (8)”, the constraint is “NOT NULL”, and the primary key is “◯” is set. This indicates that the column name “GRCD” can register data of variable length character type 8 digits and not “NULL”, and “GRCD” is a primary key. Note that “-(hyphen)” is set in the item of the primary key of “GRNAME” or “USERID” which is a column that is not the primary key.

なお、このようなテーブル構造は、例えば、所定のDDLファイルにより記述される。
図7は、テンプレート記憶部に格納されるファイルの例を示す図である。テンプレート記憶部130には、DAOクラス用テンプレートファイル131、クエリ記述用テンプレートファイル132、コンテキスト用テンプレートファイル133およびサンプルクラス用テンプレートファイル134が記憶される。
Such a table structure is described by a predetermined DDL file, for example.
FIG. 7 is a diagram illustrating an example of a file stored in the template storage unit. The template storage unit 130 stores a DAO class template file 131, a query description template file 132, a context template file 133, and a sample class template file 134.

DAOクラス用テンプレートファイル131は、DAOクラス生成部140が生成するDAOクラスの雛形である。
クエリ記述用テンプレートファイル132は、クエリ記述ファイル生成部150が生成するクエリ記述ファイルの雛形である。
The DAO class template file 131 is a DAO class template generated by the DAO class generation unit 140.
The query description template file 132 is a template of a query description file generated by the query description file generation unit 150.

コンテキスト用テンプレートファイル133は、コンテキストファイル生成部170が生成するコンテキストファイルの雛形である。
サンプルクラス用テンプレートファイル134は、サンプルクラス生成部180が生成するサービスクラスの雛形である。
The context template file 133 is a model of a context file generated by the context file generation unit 170.
The sample class template file 134 is a service class template generated by the sample class generation unit 180.

これらのテンプレートファイルは、予めテンプレート記憶部130に格納される。
図8は、DAOクラス用テンプレートファイルの例を示す図である。DAOクラス用テンプレートファイル131は、DAOインタフェースの雛形である。DAOクラス用テンプレートファイル131は、コード131a,131b,131cを有する。DAOクラス生成部140は、コード131a,131b,131cに含まれる文字列“{0}、{1}、{2}、{3}”で示される箇所を適切な文字列で置換することによりDAOクラスのインタフェースを生成することができる。
These template files are stored in the template storage unit 130 in advance.
FIG. 8 is a diagram illustrating an example of a DAO class template file. The DAO class template file 131 is a template of the DAO interface. The DAO class template file 131 includes codes 131a, 131b, and 131c. The DAO class generation unit 140 replaces the portion indicated by the character strings “{0}, {1}, {2}, {3}” included in the codes 131a, 131b, and 131c with an appropriate character string, thereby enabling the DAO class. A class interface can be created.

コード131aは、DAOクラスが所属するパッケージを指定する。DAOクラス生成部140は、文字列“{2}”をDAOクラスのパッケージ名に置換する。
コード131bは、インポートするORMクラスを指定する。DAOクラス生成部140は、文字列“{3}”をORMクラスのパッケージ名に置換し、文字列“{0}”をDAOクラスに対応するORMクラス名で置換する。
The code 131a specifies a package to which the DAO class belongs. The DAO class generation unit 140 replaces the character string “{2}” with the package name of the DAO class.
The code 131b specifies the ORM class to be imported. The DAO class generation unit 140 replaces the character string “{3}” with the package name of the ORM class, and replaces the character string “{0}” with the ORM class name corresponding to the DAO class.

コード131cは、DAOクラスのインタフェースを定義する。DAOクラス生成部140は、文字列“0”をDAOクラスに対応するORMクラス名で置換し、文字列“{1}”を該当のORMクラスの主キークラス名で置換する。DAOクラスの名称は、例えば、ORMクラス名の後に“Dao”の文字列を付加した名称とする。   The code 131c defines the DAO class interface. The DAO class generation unit 140 replaces the character string “0” with the ORM class name corresponding to the DAO class, and replaces the character string “{1}” with the primary key class name of the corresponding ORM class. The name of the DAO class is, for example, a name in which the character string “Dao” is added after the ORM class name.

なお、DAOクラス生成部140が生成するDAOクラスは、インタフェースのみでよく、実装(Implement)は不要である。メソッドは、汎用DAOクラス(“GenericDao”クラス)に定義されたものを複数のDAOクラスで共通的に利用することができる。   Note that the DAO class generated by the DAO class generation unit 140 may be an interface only and does not need to be implemented. The method defined in the generic DAO class (“GenericDao” class) can be used in common by a plurality of DAO classes.

ここで、“GenaricDao”には、ORMクラスのデータ型と該当のORMクラスに対応するテーブルの主キーの型を設定することができる。これによって、各DAOクラスに入力されるデータや主キーの型の不一致をDAOクラスの生成段階で未然に防止することができる。すなわち、DAOクラスの型安全性を確保することができる。   Here, in “GenaricDao”, the data type of the ORM class and the primary key type of the table corresponding to the corresponding ORM class can be set. As a result, it is possible to prevent inconsistency between the data input to each DAO class and the primary key type at the DAO class generation stage. That is, the DAO class type safety can be ensured.

なお、動的に変化するクエリを扱うDAOクラスの場合には、該当のDAOクラスで個別に実装クラスを作成することで対応が可能である。
図9は、クエリ記述用テンプレートファイルの例を示す図である。クエリ記述ファイル生成部150は、クエリ記述用テンプレートファイル132に記述された内容に基づいて、クエリ記述ファイルを生成する。開発者は、生成されたクエリ記述ファイルに汎用DAOクラスで定義されない複雑なテーブル操作用のクエリを業務ロジックに応じてタグ132aに記述することができる。
In the case of a DAO class that handles a dynamically changing query, it can be dealt with by creating an implementation class individually with the corresponding DAO class.
FIG. 9 is a diagram illustrating an example of a template file for query description. The query description file generation unit 150 generates a query description file based on the contents described in the query description template file 132. The developer can describe, in the tag 132a, a complicated table operation query that is not defined in the general-purpose DAO class in the generated query description file according to the business logic.

図10は、コンテキスト用テンプレートファイルの例を示す第1の図である。コンテキスト用テンプレートファイル133には、サービスの実行に用いる複数のビーン(Bean)が定義される。コンテキスト用テンプレートファイル133には、タグ133a,133b,133cが設けられる。   FIG. 10 is a first diagram illustrating an example of a context template file. In the context template file 133, a plurality of beans (Beans) used to execute the service are defined. In the context template file 133, tags 133a, 133b, and 133c are provided.

タグ133aには、“dataSourceMain”ビーンが定義される。“dataSourceMain”は、データベース210に対する接続情報を管理する。“dataSourceMain”には、例えば、DB接続情報20のドライバクラス21、DB接続先情報22、DB接続ユーザ名23およびパスワード24などの情報が設定される。   In the tag 133a, a “dataSourceMain” bean is defined. “DataSourceMain” manages connection information for the database 210. For example, information such as the driver class 21 of the DB connection information 20, the DB connection destination information 22, the DB connection user name 23, and the password 24 is set in “dataSourceMain”.

タグ133bには、“sessionFactory”ビーンが定義される。“sessionFactory”は、“dataSourceMain”を参照して、データベース210の各テーブルに対する操作を行う。“sessionFactory”には、処理に必要な定義情報であるORMファイル(例えば、“(ORMクラス名).hbm.xml”のファイル名で指定される)やクエリ記述ファイル(例えば、“(ORMクラス名).hql.xml”のファイル名で指定される)が設定される。   In the tag 133b, a “sessionFactory” bean is defined. “SessionFactory” refers to “dataSourceMain” and performs an operation on each table of the database 210. In “sessionFactory”, an ORM file (for example, specified by a file name of “(ORM class name) .hbm.xml”) or a query description file (for example, “(ORM class name)” is definition information necessary for processing. ) .Hql.xml ”is specified).

タグ133cには、“transactionManager”ビーンが定義される。“transactionManager”は、“sessionFactory”を参照して、データベース210とのトランザクションの管理を行う。ここで、トランザクションの管理とは、データベース210に対するコミットやロールバックの制御などを示す。   In the tag 133c, a “transactionManager” bean is defined. “TransactionManager” refers to “sessionFactory” and manages transactions with the database 210. Here, transaction management refers to control of commit and rollback for the database 210 and the like.

図11は、コンテキスト用テンプレートファイルの例を示す第2の図である。コンテキスト用テンプレートファイル133には、更に、タグ133d,133e,133fが設けられる。   FIG. 11 is a second diagram illustrating an example of a context template file. The context template file 133 is further provided with tags 133d, 133e, and 133f.

タグ133dには、“txAttribute”ビーンが定義される。“txAttribute”は、メソッドに対するトランザクションの属性を管理する。“txAttribute”には、例えば、“read”や“get”などの文字列で始まるメソッドに対し、新たなトランザクションを開始する、読み取り専用とするなど、トランザクションを制御するための属性が定義される。   In the tag 133d, a “txAttribute” bean is defined. “TxAttribute” manages the transaction attribute for the method. In “txAttribute”, for example, an attribute for controlling a transaction is defined such that a new transaction is started or read-only for a method starting with a character string such as “read” or “get”.

タグ133eには、“txInterceptor”ビーンが定義される。“txInterceptor”は、トランザクション管理の機能を他のクラスの実行時に呼び出すためのビーンである。“txInterceptor”は、タグ133cの“transactionManager”やタグ133dの“txAttribute”を参照する。   In the tag 133e, a “txInterceptor” bean is defined. “TxInterceptor” is a bean for calling a transaction management function when another class is executed. “TxInterceptor” refers to “transactionManager” of the tag 133c and “txAttribute” of the tag 133d.

タグ133fには、“applicationLoggingInterceptor”ビーンが定義される。“applicationLoggingInterceptor”は、ログ出力用の機能を他のクラスの実行時に呼び出すためのビーンである。   The tag 133f defines an “applicationLoggingInterceptor” bean. “ApplicationLoggingInterceptor” is a bean for calling a log output function when another class is executed.

図12は、コンテキスト用テンプレートファイルの例を示す第3の図である。コンテキスト用テンプレートファイル133には、更に、タグ133g,133h,133iが設けられる。   FIG. 12 is a third diagram illustrating an example of a context template file. The context template file 133 is further provided with tags 133g, 133h, and 133i.

タグ133gには、“serviceThrowsAdvice”ビーンが定義される。“serviceThrowsAdvice”は、サービスクラスにおける例外処理を行う機能をサービスクラスの実行時に呼び出すためのビーンである。   In the tag 133g, a “serviceThrowsAdvice” bean is defined. “ServiceThrowsAdvice” is a bean for calling a function that performs exception handling in a service class when the service class is executed.

タグ133hには、“daoThrowsAdvice”ビーンが定義される。“daoThrowsAdvice”は、DAOクラスにおける例外処理を行う機能をDAOクラスの実行時に呼び出すためのビーンである。   In the tag 133h, a “daoThrowsAdvice” bean is defined. “DaoThrowsAdvice” is a bean for calling a function for performing exception handling in the DAO class when the DAO class is executed.

タグ133iには、“autoProxyCreator”ビーンが定義される。“autoProxyCreator”は、サービスクラスの実行時に、タグ133e,133f,133gで定義した各ビーンを呼び出すためのビーンである。   In the tag 133i, an “autoProxyCreator” bean is defined. “AutoProxyCreator” is a bean for calling each bean defined by the tags 133e, 133f, and 133g when the service class is executed.

図13は、コンテキスト用テンプレートファイルの例を示す第4の図である。コンテキスト用テンプレートファイル133には、更に、タグ133j,133k,133l,133mが設けられる。タグ133j,133k,133l,133mには、DAOクラスの実行時に共通的に呼び出されるビーンが定義される。   FIG. 13 is a fourth diagram illustrating an example of a context template file. The context template file 133 is further provided with tags 133j, 133k, 133l, and 133m. The tags 133j, 133k, 133l, and 133m define a bean that is commonly called when the DAO class is executed.

タグ133jには、“finderIntroductionAdvisor”ビーンが定義される。“finderIntroductionAdvisor”は、各DAOクラスのメソッドのうち汎用DAOクラスが利用できない場合に、該当のDAOクラスに対応するクエリ記述ファイルを呼び出すためのビーンである。   In the tag 133j, a “finderIntroductionAdvisor” bean is defined. “FinderIntroductionAdvisor” is a bean for calling a query description file corresponding to a corresponding DAO class when a general-purpose DAO class cannot be used among the methods of each DAO class.

タグ133kには、“abstractDaoTarget”ビーンが定義される。“abstractDaoTarget”は、共通部品記憶部160に記憶された汎用DAOクラスのインスタンスを各DAOクラスで再利用可能とするためのビーンである。   An “abstractDaoTarget” bean is defined in the tag 133k. “AbstractDaoTarget” is a bean for making an instance of the general-purpose DAO class stored in the common component storage unit 160 reusable in each DAO class.

タグ133lには、“abstractDao”ビーンが定義される。“abstractDao”は、各DAOクラスに“finderIntroductionAdvisor”の機能を付加するためのビーンである。
タグ133mには、“daoAutoProxyCreator”が定義される。“daoAutoProxyCreator”は、各DAOクラスの実行時に、タグ133f,133hで定義した各ビーンを呼び出すためのビーンである。
An “abstractDao” bean is defined in the tag 133l. “AbstractDao” is a bean for adding the function of “finderIntroductionAdvisor” to each DAO class.
In the tag 133m, “daoAutoProxyCreator” is defined. “DaoAutoProxyCreator” is a bean for calling each bean defined by the tags 133f and 133h when each DAO class is executed.

図14は、コンテキスト用テンプレートファイルの例を示す第5の図である。コンテキスト用テンプレートファイル133には、更に、タグ133n,133oが設けられる。
タグ133nには、DAOクラスのビーンが、DAOクラス毎に定義される。ビーンの識別情報を示す“bean id”には、適切な文字列が置換されて設定される。プロパティ“proxyInterfaces”には、DAOクラス記憶部145に記憶されたDAOクラスを指定する適切な文字列が置換されて設定される。また、“abstractDaoTarget”のコンストラクタに該当のDAOクラスに対応するORMクラスを設定する。
FIG. 14 is a fifth diagram illustrating an example of a context template file. The context template file 133 is further provided with tags 133n and 133o.
In the tag 133n, a DAO class bean is defined for each DAO class. An appropriate character string is replaced and set in “bean id” indicating the bean identification information. In the property “proxyInterfaces”, an appropriate character string designating the DAO class stored in the DAO class storage unit 145 is replaced and set. Also, an ORM class corresponding to the corresponding DAO class is set in the constructor of “abstractDaoTarget”.

なお、タグ133nでは、実装が不要なDAOクラスのビーンを定義しているが、例えば、処理要求に応じて可変なクエリを扱う場合には実装が必要となる。この場合は、コンテキスト用テンプレートファイル133に実装が必要なDAOクラスのビーンを直接定義することが可能である。   The tag 133n defines a DAO class bean that does not need to be implemented. For example, when a variable query is handled according to a processing request, the tag 133n needs to be implemented. In this case, it is possible to directly define a DAO class bean that needs to be implemented in the context template file 133.

タグ133oには、“sampleService”ビーンが定義される。“sampleService”は、サービスクラスのビーンである。“sampleService”には、DAOクラスを設定するためのプロパティタグが設けられており、DAOクラス毎の名称が設定される。   In the tag 133o, a “sampleService” bean is defined. “SampleService” is a bean of a service class. In “sampleService”, a property tag for setting a DAO class is provided, and a name for each DAO class is set.

図15は、サンプルクラス用テンプレートファイルの例を示す図である。サンプルクラス用テンプレートファイル134には、コード134a,134b,134cが設けられている。   FIG. 15 is a diagram illustrating an example of a sample class template file. In the sample class template file 134, codes 134a, 134b, and 134c are provided.

コード134aは、インポートするDAOクラスやORMクラスを指定する。サンプルクラス生成部180は、コード134aに全てのDAOクラスやORMクラスを示す適切な文字列を設定する。   The code 134a specifies the DAO class or ORM class to be imported. The sample class generation unit 180 sets an appropriate character string indicating all DAO classes and ORM classes in the code 134a.

コード134bは、各DAOクラスのオブジェクト変数を定義する。サンプルクラス生成部180は、コード134bに全てのDAOクラスとそのオブジェクト名とを示す適切な文字列を設定する。   The code 134b defines an object variable for each DAO class. The sample class generation unit 180 sets an appropriate character string indicating all DAO classes and their object names in the code 134b.

コード134cは、定義したオブジェクト変数に関するメソッド(例えば、DIにより、DAOクラスのインスタンスへの参照を設定するためのメソッド)を定義する。サンプルクラス生成部180は、全てのオブジェクト変数に関してメソッドを定義する。   The code 134c defines a method related to the defined object variable (for example, a method for setting a reference to an instance of the DAO class by DI). The sample class generation unit 180 defines methods for all object variables.

図16は、共通部品記憶部に格納されるファイルの例を示す図である。共通部品記憶部160には、各クラスで再利用可能なコンポーネントのファイルが記憶される。共通部品記憶部160は、DBコネクション管理用クラス161、DBトランザクション管理用クラス162、ログ出力用クラス163および例外処理用クラス164が記憶される。   FIG. 16 is a diagram illustrating an example of a file stored in the common component storage unit. The common component storage unit 160 stores component files that can be reused in each class. The common component storage unit 160 stores a DB connection management class 161, a DB transaction management class 162, a log output class 163, and an exception processing class 164.

DBコネクション管理用クラス161は、データベース接続用のクラスである。DBコネクション管理用クラス161には、例えば、コンテキスト用テンプレートファイル133のタグ133aの“dataSourceMain”ビーンやタグ133bの“sessionFactory”ビーンなどのクラスが含まれる。   The DB connection management class 161 is a database connection class. The DB connection management class 161 includes, for example, classes such as a “dataSourceMain” bean of the tag 133 a and a “sessionFactory” bean of the tag 133 b of the context template file 133.

DBトランザクション管理用クラス162は、データベースに対するコミットやロールバックなどのトランザクションを管理するためのクラスである。DBトランザクション管理用クラス162には、例えば、コンテキスト用テンプレートファイル133のタグ133cの“transactionManager”ビーン、タグ133dの“txAttribute”ビーンおよびタグ133eの“txInterceptor”ビーンなどのクラスが含まれる。   The DB transaction management class 162 is a class for managing transactions such as commit and rollback for the database. The DB transaction management class 162 includes classes such as a “transactionManager” bean of the tag 133c, a “txAttribute” bean of the tag 133d, and a “txInterceptor” bean of the tag 133e in the context template file 133.

ログ出力用クラス163は、ログを出力するためのクラスである。ログ出力用クラス163には、例えば、コンテキスト用テンプレートファイル133のタグ133fの“applicationLoggingInterceptor”ビーンのクラスが含まれる。   The log output class 163 is a class for outputting a log. The log output class 163 includes, for example, the “applicationLoggingInterceptor” bean class of the tag 133f of the context template file 133.

例外処理用クラス164は、実行時の例外処理用のクラスである。例外処理用クラス164には、例えば、コンテキスト用テンプレートファイル133のタグ133gの“serviceThrowsAdvice”ビーンやタグ133hの“daoThrowsAdvice”ビーンなどのクラスが含まれる。   The exception handling class 164 is a class for exception handling at the time of execution. The exception processing class 164 includes, for example, classes such as a “serviceThrowsAdvice” bean of the tag 133g of the context template file 133 and a “daoThrowsAdvice” bean of the tag 133h.

図17は、汎用DAOクラスの例を示す図である。汎用DAOクラス145aは、DAOクラス記憶部145に予め格納される。汎用DAOクラス145aは、複数のDAOクラスで共通的に利用される主要な機能を定義する。汎用DAOクラス145aには、例えば、CRUDの処理や排他有主キー検索および排他開放待ち無主キー検索が定義される。   FIG. 17 is a diagram illustrating an example of a general-purpose DAO class. The general-purpose DAO class 145a is stored in advance in the DAO class storage unit 145. The general-purpose DAO class 145a defines main functions commonly used by a plurality of DAO classes. In the general-purpose DAO class 145a, for example, CRUD processing, exclusive-owner key search, and exclusive-release waiting main key search are defined.

ここで、排他有主キー検索とは、データをロックして主キー検索を行う機能である。
また、排他無主キー検索も同様にデータをロックして主キー検索を行う機能である。但し、排他無主キー検索では、該当のデータが他の処理で既にロックされている場合、ロックの開放を待たずに例外処理を行う。
Here, the exclusive primary key search is a function for performing primary key search by locking data.
Similarly, the exclusive non-primary key search is a function for locking the data and performing the primary key search. However, in the exclusive primary key search, if the corresponding data is already locked by another process, exception processing is performed without waiting for the lock to be released.

このように、各DAOクラスにおいて、データベース210に対するこれらの処理を行う場合には、汎用DAOクラス145aに定義された機能を用いて処理を実行させることで、各DAOクラスで実装を不要とすることができる。   As described above, when each processing is performed on the database 210 in each DAO class, the processing is executed using the function defined in the general-purpose DAO class 145a, thereby making the implementation unnecessary in each DAO class. Can do.

次に、以上のような構成を備えるコンピュータ100において実行される処理の詳細を説明する。
図18は、第1の実施の形態のプログラム生成処理の手順を示すフローチャートである。以下、図18に示す処理をステップ番号に沿って説明する。
Next, details of processing executed in the computer 100 having the above-described configuration will be described.
FIG. 18 is a flowchart illustrating the procedure of the program generation process according to the first embodiment. In the following, the process illustrated in FIG. 18 will be described in order of step number.

[ステップS1]ORMファイル生成部110は、DB接続情報およびデータベース210のテーブル構造に基づいてORMを実行し、ORMファイルを生成する。ORMファイル生成部110は、生成したORMファイルをORMファイル記憶部115に格納する。   [Step S1] The ORM file generation unit 110 executes the ORM based on the DB connection information and the table structure of the database 210 to generate an ORM file. The ORM file generation unit 110 stores the generated ORM file in the ORM file storage unit 115.

[ステップS2]ORMクラス生成部120は、ORMファイル記憶部115に記憶されたORMファイルに基づいて、データベース210の各テーブルに値を格納または、各テーブルから値を読み出すためのORMクラスを生成する。ORMクラス生成部120は、生成したORMクラスをORMクラス記憶部125に格納する。   [Step S2] The ORM class generation unit 120 generates an ORM class for storing a value in each table of the database 210 or reading a value from each table based on the ORM file stored in the ORM file storage unit 115. . The ORM class generation unit 120 stores the generated ORM class in the ORM class storage unit 125.

[ステップS3]DAOクラス生成部140は、テンプレート記憶部130に記憶されたDAOクラス用テンプレートファイル131とORMクラス記憶部125に記憶されたORMクラスの名称とに基づいて、DAOクラスを生成する。DAOクラス生成部140は、生成したDAOクラスをDAOクラス記憶部145に格納する。   [Step S <b> 3] The DAO class generation unit 140 generates a DAO class based on the DAO class template file 131 stored in the template storage unit 130 and the ORM class name stored in the ORM class storage unit 125. The DAO class generation unit 140 stores the generated DAO class in the DAO class storage unit 145.

[ステップS4]クエリ記述ファイル生成部150は、テンプレート記憶部130に記憶されたクエリ記述用テンプレートファイル132とDAOクラス記憶部145に記憶されたDAOクラスの名称とに基づいて、クエリ記述ファイルを生成する。クエリ記述ファイル生成部150は、生成したクエリ記述ファイルをクエリ記述ファイル記憶部155に格納する。   [Step S <b> 4] The query description file generation unit 150 generates a query description file based on the query description template file 132 stored in the template storage unit 130 and the DAO class name stored in the DAO class storage unit 145. To do. The query description file generation unit 150 stores the generated query description file in the query description file storage unit 155.

[ステップS5]コンテキストファイル生成部170は、テンプレート記憶部130に記憶されたコンテキスト用テンプレートファイル133とDAOクラス記憶部145に記憶されたDAOクラスの名称とに基づいて、コンテキストファイルを生成する。コンテキストファイル生成部170は、生成したコンテキストファイル記憶部175に格納する。   [Step S <b> 5] The context file generation unit 170 generates a context file based on the context template file 133 stored in the template storage unit 130 and the DAO class name stored in the DAO class storage unit 145. The context file generation unit 170 stores the generated context file storage unit 175.

[ステップS6]サンプルクラス生成部180は、テンプレート記憶部130に記憶されたサンプルクラス用テンプレートファイル134とDAOクラス記憶部145に記憶されたDAOクラスの名称とに基づいて、サンプルのアプリケーションであるサンプルクラスを生成する。サンプルクラス生成部180は、生成したサンプルクラスをサンプルクラス記憶部185に格納する。   [Step S6] The sample class generation unit 180 is a sample application that is a sample application based on the sample class template file 134 stored in the template storage unit 130 and the name of the DAO class stored in the DAO class storage unit 145. Generate a class. The sample class generation unit 180 stores the generated sample class in the sample class storage unit 185.

[ステップS7]配置部190は、コンテキストファイル記憶部175に記憶されたコンテキストファイルに基づいて、DAOクラス、サンプルクラスおよび共通コンポーネントなどの各クラスをメモリ上に配置する。実行部195は、コンテキストファイルに基づいて、配置部190が配置したクラス間の関連付けを行い、サンプルクラスを実行する。   [Step S7] The placement unit 190 places each class such as a DAO class, a sample class, and a common component on the memory based on the context file stored in the context file storage unit 175. The execution unit 195 associates the classes arranged by the arrangement unit 190 based on the context file, and executes the sample class.

このようにして、DAOクラスやサンプルクラスが自動生成される。このとき、実行時に必要となるデータベース210への接続、トランザクションの管理、ログ出力および例外処理の機能が予め用意され、各クラスの実行時に自動的に呼び出されるよう構成される。このため、開発者は、これらの機能を呼び出すためのコーディングをDAOクラス毎に行う必要がなくなる。これにより、アプリケーションが扱うテーブルが多数存在する場合でも、これら機能を組み込むための工数を削減することができる。また、生成した各クラスを実行環境に登録するためのコンテキストファイルを作成する工数を削減することができる。   In this way, DAO classes and sample classes are automatically generated. At this time, functions such as connection to the database 210, transaction management, log output, and exception handling necessary for execution are prepared in advance, and are configured to be automatically called when each class is executed. This eliminates the need for the developer to perform coding for calling these functions for each DAO class. Thereby, even when there are a large number of tables handled by the application, the man-hours for incorporating these functions can be reduced. In addition, the number of steps for creating a context file for registering each generated class in the execution environment can be reduced.

次に、上記処理手順の各ステップにおける処理の手順を更に詳しく説明する。
図19は、第1の実施の形態のORMファイル生成処理の手順を示すフローチャートである。以下、図19に示す処理をステップ番号に沿って説明する。なお、以下の処理は、上記ステップS1の処理を詳細に説明したものである。
Next, the processing procedure in each step of the above processing procedure will be described in more detail.
FIG. 19 is a flowchart illustrating a procedure of ORM file generation processing according to the first embodiment. In the following, the process illustrated in FIG. 19 will be described in order of step number. The following process describes the process of step S1 in detail.

[ステップS11]ORMファイル生成部110は、DB接続情報20に設定された情報に基づいて、データベース210に接続する。
[ステップS12]ORMファイル生成部110は、DB接続情報20に設定されたORMの対象テーブルからORMファイル未作成のテーブル情報(例えば、DDL)を1つ取得して、データベース210における該当のテーブル情報を参照する。
[Step S11] The ORM file generation unit 110 connects to the database 210 based on the information set in the DB connection information 20.
[Step S12] The ORM file generation unit 110 acquires one table information (for example, DDL) in which the ORM file has not been created from the ORM target table set in the DB connection information 20, and the corresponding table information in the database 210. Refer to

[ステップS13]ORMファイル生成部110は、参照したテーブル情報に含まれるカラムの情報を抽出する。
[ステップS14]ORMファイル生成部110は、参照したテーブル情報に含まれる全てのカラムの情報を抽出したか否かを判定する。全てのカラムの情報を抽出済みの場合、処理がステップS15に移される。未抽出のカラムが存在する場合、処理がステップS13に移される。
[Step S13] The ORM file generation unit 110 extracts column information included in the referenced table information.
[Step S14] The ORM file generation unit 110 determines whether or not information on all columns included in the referenced table information has been extracted. If all the column information has been extracted, the process proceeds to step S15. If an unextracted column exists, the process proceeds to step S13.

[ステップS15]ORMファイル生成部110は、抽出したカラムの情報に基づいて、ORMファイルを生成し、ORMファイル記憶部115に出力する。
[ステップS16]ORMファイル生成部110は、DB接続情報20に設定された全てのテーブルに関してORMファイルを生成済みであるか否かを判定する。全てのテーブルに関してORMファイルを生成済みである場合、処理が完了する。ORMファイルを未生成のテーブルが存在する場合、処理がステップS12に移される。
[Step S15] The ORM file generation unit 110 generates an ORM file based on the extracted column information, and outputs the ORM file to the ORM file storage unit 115.
[Step S <b> 16] The ORM file generation unit 110 determines whether ORM files have been generated for all the tables set in the DB connection information 20. If the ORM file has been generated for all the tables, the process is completed. If there is a table for which no ORM file has been generated, the process proceeds to step S12.

このようにして、データベース210に存在する各テーブルのカラムが参照され、それぞれのカラムの情報が、テーブル毎に生成されるORMファイルにマッピングされる。ORMファイルのファイル形式は、例えば、xml形式である。   In this way, the columns of each table existing in the database 210 are referred to, and the information of each column is mapped to the ORM file generated for each table. The file format of the ORM file is, for example, the xml format.

図20は、第1の実施の形態のORMクラス生成処理の手順を示すフローチャートである。以下、図20に示す処理をステップ番号に沿って説明する。なお、以下の処理は、上記ステップS2の処理を詳細に説明したものである。   FIG. 20 is a flowchart illustrating a procedure of ORM class generation processing according to the first embodiment. In the following, the process illustrated in FIG. 20 will be described in order of step number. The following process describes the process in step S2 in detail.

[ステップS21]ORMクラス生成部120は、ORMファイル記憶部115に記憶されたORMファイルのうち、未処理のORMファイルを1つ取得する。
[ステップS22]ORMクラス生成部120は、ORMファイルに設定されたカラムのうち未処理のカラムを1つ抽出する。
[Step S21] The ORM class generation unit 120 acquires one unprocessed ORM file among the ORM files stored in the ORM file storage unit 115.
[Step S22] The ORM class generation unit 120 extracts one unprocessed column from the columns set in the ORM file.

[ステップS23]ORMクラス生成部120は、抽出したカラムの属性を取得し、該当のカラムの属性情報を生成する。
[ステップS24]ORMクラス生成部120は、抽出したカラムに設定された情報を取得するためのGetterメソッドを生成する。
[Step S23] The ORM class generation unit 120 acquires the attribute of the extracted column, and generates attribute information of the corresponding column.
[Step S24] The ORM class generation unit 120 generates a Getter method for acquiring information set in the extracted column.

[ステップS25]ORMクラス生成部120は、抽出したカラムに情報を設定するためのSetterメソッドを生成する。
[ステップS26]ORMクラス生成部120は、ORMファイルに含まれる全てのカラムに関して、属性情報、GetterメソッドおよびSetterメソッドを生成済みであるか否かを判定する。全てのカラムに関して処理済みである場合、処理がステップS27に移される。未処理のカラムが存在する場合、処理がステップS22に移される。
[Step S25] The ORM class generator 120 generates a Setter method for setting information in the extracted column.
[Step S26] The ORM class generation unit 120 determines whether or not the attribute information, the Getter method, and the Setter method have been generated for all the columns included in the ORM file. If all columns have been processed, the process proceeds to step S27. If there is an unprocessed column, the process proceeds to step S22.

[ステップS27]ORMクラス生成部120は、生成したカラムの属性情報、GetterメソッドおよびSetterメソッドを設定したORMクラスをORMクラス記憶部125に出力する。   [Step S <b> 27] The ORM class generation unit 120 outputs the generated column attribute information, the Getter method, and the ORM class in which the Setter method is set to the ORM class storage unit 125.

[ステップS28]ORMクラス生成部120は、全てのORMファイルについてORMクラスを生成したか否かを判定する。全てのORMファイルについてORMクラスを生成した場合、処理が完了する。ORMクラスを未生成のORMファイルが存在する場合、処理がステップS21に移される。   [Step S28] The ORM class generation unit 120 determines whether ORM classes have been generated for all ORM files. When the ORM class is generated for all ORM files, the process is completed. If there is an ORM file for which no ORM class has been generated, the process proceeds to step S21.

このようにして、各ORMファイルに対するORMクラスが生成される。
図21は、第1の実施の形態のDAOクラス生成処理の手順を示すフローチャートである。以下、図21に示す処理をステップ番号に沿って説明する。なお、以下の処理は、上記ステップS3の処理を詳細に説明したものである。
In this way, an ORM class for each ORM file is generated.
FIG. 21 is a flowchart illustrating a procedure of DAO class generation processing according to the first embodiment. In the following, the process illustrated in FIG. 21 will be described in order of step number. Note that the following processing describes the processing in step S3 in detail.

[ステップS31]DAOクラス生成部140は、ORMクラス記憶部125に記憶されたORMクラスのファイルリストを取得する。
[ステップS32]DAOクラス生成部140は、取得したファイルリストから未処理のORMクラスを1つ取得する。
[Step S31] The DAO class generation unit 140 acquires an ORM class file list stored in the ORM class storage unit 125.
[Step S32] The DAO class generation unit 140 acquires one unprocessed ORM class from the acquired file list.

[ステップS33]DAOクラス生成部140は、ORMクラスのソースコードを参照する。
[ステップS34]DAOクラス生成部140は、参照したソースコードからORMクラスの名称を抽出する。具体的には、例えば参照したソースコードに含まれる各行について、行頭の“public class”の文字列の後に続いて定義されるクラス名を抽出する。
[Step S33] The DAO class generation unit 140 refers to the ORM class source code.
[Step S34] The DAO class generation unit 140 extracts the name of the ORM class from the referenced source code. Specifically, for example, for each line included in the referenced source code, a class name defined following the character string “public class” at the beginning of the line is extracted.

[ステップS35]DAOクラス生成部140は、該当のORMクラスに含まれる主キークラス名を抽出する。具体的には、例えば参照したソースコードに含まれる各行について、最初に現れる行頭の“private”の文字列の後に続いて定義されるクラス名を抽出する。   [Step S35] The DAO class generation unit 140 extracts a primary key class name included in the corresponding ORM class. Specifically, for example, for each line included in the referenced source code, the class name defined following the character string “private” at the beginning of the line that appears first is extracted.

[ステップS36]DAOクラス生成部140は、テンプレート記憶部130に記憶されたDAOクラス用テンプレートファイル131を読み込む。
[ステップS37]DAOクラス生成部140は、DAOクラス用テンプレートファイル131に取得した情報を設定する。具体的には、DAOクラス用テンプレートファイル131の文字列“{0}”を上記ステップS34で取得したORMクラス名に置換する。同様に、文字列“{1}”を上記ステップS35で取得した主キークラス名に置換する。また、文字列“{2}”をDAOのパッケージ名に置換し、文字列“{3}”をORMのパッケージ名に置換する。
[Step S <b> 36] The DAO class generation unit 140 reads the DAO class template file 131 stored in the template storage unit 130.
[Step S37] The DAO class generation unit 140 sets the acquired information in the DAO class template file 131. Specifically, the character string “{0}” in the DAO class template file 131 is replaced with the ORM class name acquired in step S34. Similarly, the character string “{1}” is replaced with the primary key class name acquired in step S35. Also, the character string “{2}” is replaced with the DAO package name, and the character string “{3}” is replaced with the ORM package name.

[ステップS38]DAOクラス生成部140は、DAOクラス用テンプレートファイル131を置換して生成したDAOクラスをDAOクラス記憶部145に出力する。
[ステップS39]DAOクラス生成部140は、ファイルリストに含まれる全てのORMクラスに関して、DAOクラスを生成済みであるか否かを判定する。全てのORMクラスに関してDAOクラスを生成済みである場合、処理が完了する。DAOクラスを未生成のORMクラスが存在する場合、処理がステップS32に移される。
[Step S38] The DAO class generation unit 140 outputs the DAO class generated by replacing the DAO class template file 131 to the DAO class storage unit 145.
[Step S39] The DAO class generation unit 140 determines whether or not a DAO class has been generated for all ORM classes included in the file list. If the DAO class has been generated for all ORM classes, the process is completed. If there is an ORM class for which no DAO class has been generated, the process proceeds to step S32.

このようにして、各ORMクラスに対するDAOクラスが生成される。
図22は、第1の実施の形態のクエリ記述ファイル生成処理の手順を示すフローチャートである。以下、図22に示す処理をステップ番号に沿って説明する。なお、以下の処理は、上記ステップS4の処理を詳細に説明したものである。
In this way, a DAO class for each ORM class is generated.
FIG. 22 is a flowchart illustrating a procedure of query description file generation processing according to the first embodiment. In the following, the process illustrated in FIG. 22 will be described in order of step number. The following process describes the process of step S4 in detail.

[ステップS41]クエリ記述ファイル生成部150は、DAOクラス記憶部125に記憶されたDAOクラスのファイルリストを取得する。
[ステップS42]クエリ記述ファイル生成部150は、取得したファイルリストから未処理のDAOクラスを1つ取得する。
[Step S41] The query description file generation unit 150 acquires a DAO class file list stored in the DAO class storage unit 125.
[Step S42] The query description file generation unit 150 acquires one unprocessed DAO class from the acquired file list.

[ステップS43]クエリ記述ファイル生成部150は、DAOクラスのファイル名からORMクラス名を取得する。
[ステップS44]クエリ記述ファイル生成部150は、テンプレート記憶部130に記憶されたクエリ記述用テンプレートファイル132を読み込む。
[Step S43] The query description file generation unit 150 acquires the ORM class name from the file name of the DAO class.
[Step S44] The query description file generation unit 150 reads the query description template file 132 stored in the template storage unit 130.

[ステップS45]クエリ記述ファイル生成部150は、クエリ記述用テンプレートファイル132に記述された内容を複製してORMクラス名に対応付けたクエリ記述用ファイルを生成し、クエリ記述ファイル記憶部155に出力する。   [Step S45] The query description file generation unit 150 generates a query description file that duplicates the content described in the query description template file 132 and associates it with the ORM class name, and outputs the query description file to the query description file storage unit 155. To do.

[ステップS46]クエリ記述ファイル生成部150は、ファイルリストに存在する全てのDAOクラスに関してクエリ記述ファイルを生成したか否かを判定する。全てのDAOクラスに関してクエリ記述ファイルを生成した場合、処理が完了する。クエリ記述ファイルを未生成のDAOクラスが存在する場合、処理がステップS42に移される。   [Step S46] The query description file generation unit 150 determines whether query description files have been generated for all DAO classes existing in the file list. When query description files are generated for all DAO classes, the process is completed. If there is a DAO class for which no query description file has been generated, the process proceeds to step S42.

このようにして、各DAOクラスについてクエリ記述ファイルが生成される。
図23は、第1の実施の形態のコンテキストファイル生成処理の手順を示すフローチャートである。以下、図23に示す処理をステップ番号に沿って説明する。なお、以下の処理は、上記ステップS5の処理を詳細に説明したものである。
In this way, a query description file is generated for each DAO class.
FIG. 23 is a flowchart illustrating a procedure of context file generation processing according to the first embodiment. In the following, the process illustrated in FIG. 23 will be described in order of step number. The following process describes the process in step S5 in detail.

[ステップS51]コンテキストファイル生成部170は、DAOクラス記憶部125に記憶されたDAOクラスのファイルリストを取得する。
[ステップS52]コンテキストファイル生成部170は、取得したファイルリストから未取得のDAOクラスを1つ取得する。
[Step S <b> 51] The context file generation unit 170 acquires a DAO class file list stored in the DAO class storage unit 125.
[Step S52] The context file generation unit 170 acquires one unacquired DAO class from the acquired file list.

[ステップS53]コンテキストファイル生成部170は、DAOクラスのファイル名からORMクラス名とDAOクラス名とを取得する。
[ステップS54]コンテキストファイル生成部170は、取得したファイルリストに含まれる全DAOクラスについてORMクラス名とDAOクラス名とを取得済みか否かを判定する。取得済みである場合、処理がステップS55に移される。未取得のDAOクラスが存在する場合、処理がステップS52に移される。
[Step S53] The context file generation unit 170 acquires the ORM class name and the DAO class name from the file name of the DAO class.
[Step S54] The context file generation unit 170 determines whether or not the ORM class name and the DAO class name have been acquired for all DAO classes included in the acquired file list. If already acquired, the process proceeds to step S55. If there is an unacquired DAO class, the process proceeds to step S52.

[ステップS55]コンテキストファイル生成部170は、テンプレート記憶部130に記憶されたコンテキスト用テンプレートファイル133を読み込む。
[ステップS56]コンテキストファイル生成部170は、タグ133aで定義されるビーンである“dataSourceMain”にDB接続パラメタを設定する。
[Step S <b> 55] The context file generation unit 170 reads the context template file 133 stored in the template storage unit 130.
[Step S56] The context file generation unit 170 sets a DB connection parameter in “dataSourceMain” which is a bean defined by the tag 133a.

[ステップS57]コンテキストファイル生成部170は、タグ133bで定義されるビーンである“sessionFactory”に、上記ステップS52〜S54で取得したORMクラス名に対応するORMファイルおよびクエリ記述ファイルを設定する。   [Step S57] The context file generation unit 170 sets an ORM file and a query description file corresponding to the ORM class name acquired in Steps S52 to S54 in “sessionFactory” which is a bean defined by the tag 133b.

[ステップS58]コンテキストファイル生成部170は、タグ133nで定義されるDAOクラスのビーンに、上記ステップS52〜S54で取得した各ORMクラス名および各DAOクラス名を設定する。   [Step S58] The context file generation unit 170 sets each ORM class name and each DAO class name acquired in Steps S52 to S54 to the DAO class bean defined by the tag 133n.

[ステップS59]コンテキストファイル生成部170は、タグ133oで定義されるサンプルのサービスクラスのビーンである“sampleService”タグに上記ステップS52〜S54で取得したDAOクラス名を設定する。   [Step S59] The context file generation unit 170 sets the DAO class name acquired in steps S52 to S54 to the “sampleService” tag that is a bean of the sample service class defined by the tag 133o.

[ステップS60]コンテキストファイル生成部170は、コンテキスト用テンプレートファイル133に基づいて生成したコンテキストファイルをコンテキストファイル記憶部175に出力し、処理が完了する。   [Step S60] The context file generation unit 170 outputs the context file generated based on the context template file 133 to the context file storage unit 175, and the processing is completed.

このようにして、コンテキスト用テンプレートファイル133のデータベース210への接続やサンプルクラスのビーンの定義情報にORMクラスやDAOクラスを自動的に設定する。また、コンテキスト用テンプレートファイル133には、共通コンポーネントであるトランザクション管理用のクラスやログ出力用のクラスなどが予め設定される。   In this manner, the ORM class and the DAO class are automatically set in the connection information of the context template file 133 to the database 210 and the bean definition information of the sample class. Also, in the context template file 133, a common component such as a transaction management class and a log output class are set in advance.

図24は、第1の実施の形態のサンプルアプリケーション生成処理の手順を示すフローチャートである。以下、図24に示す処理をステップ番号に沿って説明する。なお、以下の処理は、上記ステップS6の処理を詳細に説明したものである。   FIG. 24 is a flowchart illustrating a procedure of sample application generation processing according to the first embodiment. In the following, the process illustrated in FIG. 24 will be described in order of step number. In addition, the following process explains the process of said step S6 in detail.

[ステップS61]サンプルクラス生成部180は、DAOクラス記憶部125に記憶されたDAOクラスのファイルリストを取得する。
[ステップS62]サンプルクラス生成部180は、取得したファイルリストから未取得のDAOクラスを1つ取得する。
[Step S61] The sample class generation unit 180 obtains a DAO class file list stored in the DAO class storage unit 125.
[Step S62] The sample class generation unit 180 acquires one unacquired DAO class from the acquired file list.

[ステップS63]サンプルクラス生成部180は、DAOクラスのファイル名からORMクラス名とDAOクラス名とを取得する。
[ステップS64]サンプルクラス生成部180は、取得したファイルリストに含まれる全DAOクラスについてORMクラス名とDAOクラス名とを取得済みか否かを判定する。取得済みである場合、処理がステップS65に移される。未取得のDAOクラスが存在する場合、処理がステップS62に移される。
[Step S63] The sample class generation unit 180 obtains the ORM class name and the DAO class name from the file name of the DAO class.
[Step S64] The sample class generation unit 180 determines whether or not the ORM class name and the DAO class name have been acquired for all the DAO classes included in the acquired file list. If already acquired, the process proceeds to step S65. If an unacquired DAO class exists, the process proceeds to step S62.

[ステップS65]サンプルクラス生成部180は、テンプレート記憶部130に記憶されたサンプルクラス用テンプレートファイル134を読み込む。
[ステップS66]サンプルクラス生成部180は、サンプルクラス用テンプレートファイル134に、上記ステップS62〜S64で取得したORMクラスやDAOクラスのメソッドを追加し、サンプルのアプリケーションであるサンプルクラスを生成する。
[Step S65] The sample class generating unit 180 reads the sample class template file 134 stored in the template storage unit 130.
[Step S66] The sample class generation unit 180 adds the methods of the ORM class and DAO class acquired in steps S62 to S64 to the sample class template file 134 to generate a sample class that is a sample application.

[ステップS67]サンプルクラス生成部180は、生成したサンプルクラスをサンプルクラス記憶部185に出力し、処理が完了する。
このようにして、サンプルクラス用テンプレートファイル134に自動的にORMクラス名やDAOクラス名が設定されてサンプルクラスが生成される。生成されたサンプルクラスは、コンテキストファイルに含まれる全てのDAOクラスの定義に対して矛盾なく動作可能であるため、サンプルクラスを用いて即座にデータベース210に対するアクセス処理の動作確認を行うことができる。また、実際の業務サービスを作成する場合には、コンテキストファイルと矛盾無く生成されたサンプルクラスを複写して利用することができるので、効率良くコーディング作業を行うことができる。
[Step S67] The sample class generation unit 180 outputs the generated sample class to the sample class storage unit 185, and the processing is completed.
In this way, the ORM class name and DAO class name are automatically set in the sample class template file 134, and the sample class is generated. Since the generated sample class can operate without any contradiction with respect to all DAO class definitions included in the context file, the operation check of the access process for the database 210 can be performed immediately using the sample class. Also, when creating an actual business service, it is possible to copy and use the sample class generated without contradiction with the context file, so that coding work can be performed efficiently.

図25は、第1の実施の形態のサンプルアプリケーション実行処理の手順を示すフローチャートである。なお、サンプルのアプリケーションとは、DAOクラスとそれを用いるサンプルクラスとを実行部195により関連付けて、サンプルクラスの一連の処理を実行可能としたものである。以下、図25に示す処理をステップ番号に沿って説明する。なお、以下の処理は、上記ステップS7の処理を詳細に説明したものである。   FIG. 25 is a flowchart illustrating a procedure of sample application execution processing according to the first embodiment. The sample application associates the DAO class and the sample class using the DAO class by the execution unit 195 so that a series of processing of the sample class can be executed. In the following, the process illustrated in FIG. 25 will be described in order of step number. Note that the following processing describes the processing in step S7 in detail.

[ステップS71]配置部190は、コンテキストファイル記憶部175に記憶されたコンテキストファイルを読み込む。
[ステップS72]配置部190は、コンテキストファイルの内容に基づいて、ORMクラス記憶部125に記憶されたORMクラス、DAOクラス記憶部145に記憶されたDAOクラスおよびサンプルクラス記憶部185に記憶されたサンプルクラスをメモリ上に配置する。実行部195は、配置部190がメモリ上に配置した各クラスや共通コンポーネントのクラスの関連付けを行い、サンプルのアプリケーションが稼動状態となる。
[Step S71] The placement unit 190 reads the context file stored in the context file storage unit 175.
[Step S72] The placement unit 190 stores the ORM class stored in the ORM class storage unit 125, the DAO class stored in the DAO class storage unit 145, and the sample class storage unit 185 based on the contents of the context file. Place the sample class in memory. The execution unit 195 associates each class or common component class placed on the memory by the placement unit 190, and the sample application is in an operating state.

[ステップS73]実行部195は、サンプルクラスがデータベース210に対する処理要求を受け付けたか否かを判定する。受け付けた場合、処理がステップS74に移される。受け付けていない場合、処理がステップS78に移される。   [Step S <b> 73] The execution unit 195 determines whether the sample class has accepted a processing request for the database 210. If accepted, the process proceeds to step S74. If not received, the process proceeds to step S78.

[ステップS74]実行部195は、処理要求の内容に応じてSQL文を生成する。このとき、テーブルに対する単純なCRUDなどの処理に関しては、汎用DAOクラス145aに基づいてSQL文を生成する。また、汎用DAOクラスでサポートされない複雑なクエリに関しては、該当のDAOクラスに対するクエリ記述ファイルに基づいてSQL文を生成する。   [Step S74] The execution unit 195 generates an SQL statement according to the content of the processing request. At this time, for simple CRUD processing for the table, an SQL statement is generated based on the general-purpose DAO class 145a. For complex queries not supported by the general DAO class, an SQL statement is generated based on a query description file for the corresponding DAO class.

[ステップS75]実行部195は、DAOクラスおよびORMクラスを介してデータベース210における処理対象のテーブルに接続する。
[ステップS76]実行部195は、上記ステップS74で生成したSQL文に基づいてテーブルに対する処理を実行する。
[Step S75] The execution unit 195 connects to the table to be processed in the database 210 via the DAO class and the ORM class.
[Step S76] The execution unit 195 executes processing for the table based on the SQL statement generated in step S74.

[ステップS77]実行部195は、サンプルクラスがORMクラスおよびDAOクラスを介して処理結果の応答を受け付けると、処理要求に基づく一連の処理が完了したことを認識し、処理がステップS73に移される。   [Step S77] When the sample class receives a response of the processing result via the ORM class and the DAO class, the execution unit 195 recognizes that a series of processing based on the processing request has been completed, and the processing proceeds to step S73. .

[ステップS78]実行部195は、サンプルのアプリケーションの終了要求を受け付けたか否かを判定する。受け付けた場合、処理が完了する。受け付けていない場合、処理がステップS73に移される。   [Step S78] The execution unit 195 determines whether or not a sample application termination request has been received. If accepted, the process is complete. If not received, the process proceeds to step S73.

このようにして、生成された各クラスに基づいてサンプルのアプリケーションが実行される。各クラスの処理に必要な機能は、実行部195によって呼び出され、各クラスの実行時に付加される。また、処理要求に応じたSQL文が生成されてデータベース210の各テーブルに対する処理が実行される。   In this way, a sample application is executed based on each generated class. Functions necessary for the processing of each class are called by the execution unit 195 and added when the classes are executed. In addition, an SQL statement corresponding to the processing request is generated, and processing for each table in the database 210 is executed.

図26は、テンプレートから生成されるファイルの一覧の例を示す図である。このリストは、コンピュータ100により生成されるファイルの一覧を示している。リスト中に示される生成ファイルは、DB接続情報20のマッピング対象テーブルに、“Grouptbl”および“Ikisakitbl”を指定した場合の例である。   FIG. 26 is a diagram illustrating an example of a list of files generated from a template. This list shows a list of files generated by the computer 100. The generated file shown in the list is an example when “Grouptbl” and “Ikisakitbl” are specified in the mapping target table of the DB connection information 20.

ORMファイル生成部110は、ORMファイルとして“Grouptbl.hbm.xml”および“Ikisakitbl.hbm.xml”を生成する。
ORMクラス生成部120はORMクラスとして、“Grouptbl.java”および“Ikisakitbl.java”を生成する。
The ORM file generation unit 110 generates “Grouptbl.hbm.xml” and “Ikisakitbl.hbm.xml” as the ORM files.
The ORM class generation unit 120 generates “Grouptbl.java” and “Ikisakitbl.java” as the ORM class.

DAOクラス生成部140は、DAOクラス用テンプレートファイル131である“TemplateDAO.java”に基づいて、DAOクラス“GrouptblDAO.java”および“IkisakitblDAO.java”を生成する。   The DAO class generation unit 140 generates DAO classes “GrouptblDAO.java” and “IkisakitblDAO.java” based on “TemplateDAO.java” which is the template file 131 for DAO class.

クエリ記述ファイル生成部150は、クエリ記述用テンプレートファイル132である“template.hql.xml.vm”に基づいて、クエリ記述ファイル“Grouptbl.hql.xml”および“Ikisakitbl.hql.xml”を生成する。   The query description file generation unit 150 generates query description files “Grouptbl.hql.xml” and “Ikisakitbl.hql.xml” based on “template.hql.xml.vm” which is the template file 132 for query description. .

コンテキストファイル生成部170は、コンテキスト用テンプレートファイル133である“template-application-context.vm”に基づいて、コンテキストファイル“sample-application-context.xml”を生成する。   The context file generation unit 170 generates a context file “sample-application-context.xml” based on “template-application-context.vm” which is the context template file 133.

サンプルクラス生成部180は、サンプルクラス用テンプレートファイル134である“SampleServiceImpl.java.vm”に基づいて、サンプルクラス“SampleServiceImpl.java”を生成する。   The sample class generation unit 180 generates a sample class “SampleServiceImpl.java” based on “SampleServiceImpl.java.vm” which is the sample class template file 134.

図27は、生成されたORMファイルの例を示す図である。ORMファイル115aは、“Grouptbl.hbm.xml”の例を示している。ORMファイル115aでは、各テーブルのカラムの属性情報が設定される。   FIG. 27 is a diagram illustrating an example of the generated ORM file. The ORM file 115a shows an example of “Grouptbl.hbm.xml”. In the ORM file 115a, column attribute information of each table is set.

図28は、生成されたORMクラスの例を示す図である。ORMクラス125aは、“Grouptbl.java”の例を示している。ORMクラス125aでは、ORMファイル115aに設定された各カラムの属性情報と、GetterメソッドやSetterメソッドが定義される。   FIG. 28 is a diagram illustrating an example of the generated ORM class. The ORM class 125a shows an example of “Grouptbl.java”. In the ORM class 125a, attribute information of each column set in the ORM file 115a, a Getter method, and a Setter method are defined.

図29は、生成されたDAOクラスの例を示す図である。DAOクラス145aは、“GrouptblDAO.java”の例を示している。DAOクラス145aは、DAOクラス用テンプレートファイル131のコード131a,131b,131cに含まれる“{0}、{1}、{2}、{3}”が適切な文字列に置換されて生成されたものである。   FIG. 29 is a diagram illustrating an example of the generated DAO class. The DAO class 145a shows an example of “GrouptblDAO.java”. The DAO class 145a is generated by replacing “{0}, {1}, {2}, {3}” included in the codes 131a, 131b, and 131c of the DAO class template file 131 with appropriate character strings. Is.

図30は、生成されたクエリ記述ファイルの例を示す図である。クエリ記述ファイル155aは、“Grouptbl.hql.xml”の例を示している。クエリ記述ファイル155aには、クエリ記述用テンプレートファイル132に記述された内容が設定される。クエリ記述ファイル155aには、汎用DAOクラス145aで実行可能な処理以外の業務処理に応じたクエリを記述することができる。   FIG. 30 is a diagram illustrating an example of the generated query description file. The query description file 155a shows an example of “Grouptbl.hql.xml”. The contents described in the query description template file 132 are set in the query description file 155a. In the query description file 155a, a query corresponding to a business process other than a process that can be executed by the general-purpose DAO class 145a can be described.

図31は、生成されたコンテキストファイルの例を示す第1の図である。コンテキストファイル175aは、“sample-application-context.xml”の例を示している。コンテキストファイル175aは、コンテキスト用テンプレートファイル133に基づいて生成される。なお、コンテキストファイル175aでは、コンテキスト用テンプレートファイル133においてDB接続情報20で設定したマッピング対象テーブルに応じて設定が挿入されるタグ133a,133bに対応する箇所のみを示している。   FIG. 31 is a first diagram illustrating an example of the generated context file. The context file 175a shows an example of “sample-application-context.xml”. The context file 175a is generated based on the context template file 133. In the context file 175a, only the locations corresponding to the tags 133a and 133b into which settings are inserted according to the mapping target table set in the DB connection information 20 in the context template file 133 are shown.

図32は、生成されたコンテキストファイルの例を示す第2の図である。コンテキストファイル175aには、更に、コンテキスト用テンプレートファイル133のタグ133n,133oに対応する箇所にDAOクラスの情報が設定される。   FIG. 32 is a second diagram illustrating an example of the generated context file. In the context file 175a, DAO class information is further set at locations corresponding to the tags 133n and 133o of the context template file 133.

図33は、生成されたサンプルクラスの例を示す図である。サンプルクラス185aは、“SampleServiceImpl.java”の例を示している。サンプルクラス生成部180は、サンプルクラス用テンプレートファイル134のコード134a,134b,134cをORMクラス名およびDAOクラス名により置換することで、サンプルクラス185aを生成する。   FIG. 33 is a diagram illustrating an example of the generated sample class. The sample class 185a shows an example of “SampleServiceImpl.java”. The sample class generation unit 180 generates the sample class 185a by replacing the codes 134a, 134b, and 134c of the sample class template file 134 with the ORM class name and the DAO class name.

このように、各クラスがデータベースへの接続情報とテーブルの選択のみで自動的に生成される。サンプルクラス185aは、コンテキストファイル175aに含まれる全てのDAOクラスの定義に対して矛盾なく動作可能である。このため、サンプルクラス185aを用いて即座にデータベース210に対する処理の動作確認を行うことができる。また、実際の業務サービスを作成する際には、サンプルクラス185aを複写して利用することで、コンテキストファイル175aにおけるDAOクラスの設定に対して矛盾が生じないため、効率良くコーディング作業を行うことができる。   In this way, each class is automatically generated only by selecting database connection information and tables. The sample class 185a can operate without contradiction with respect to all DAO class definitions included in the context file 175a. For this reason, it is possible to immediately confirm the operation of the processing on the database 210 using the sample class 185a. Also, when creating an actual business service, the sample class 185a is copied and used, so that there is no contradiction to the DAO class setting in the context file 175a, so that coding work can be performed efficiently. it can.

以下では、生成されたクラスファイルの実行時の関連性を詳しく説明する。以下の説明では、生成されたクラスファイルを業務サービスを提供するWebアプリケーションとしてアプリケーションサーバ上で動作させる場合を例に挙げて説明する。   In the following, the relevance at the time of execution of the generated class file will be described in detail. In the following description, a case where the generated class file is operated on an application server as a Web application that provides a business service will be described as an example.

図34は、Webシステムの構成を示す図である。このWebシステムは、端末装置50、DBサーバ200、データベース210およびアプリケーションサーバ300を有する。   FIG. 34 is a diagram showing a configuration of a Web system. This Web system includes a terminal device 50, a DB server 200, a database 210, and an application server 300.

端末装置50は、ユーザが利用する情報処理装置である。ユーザは、端末装置50の画面に出力されるブラウザを操作してアプリケーションサーバ300に対する処理要求を入力することができる。   The terminal device 50 is an information processing device used by a user. The user can input a processing request to the application server 300 by operating a browser output on the screen of the terminal device 50.

DBサーバ200は、データベース210をアプリケーションサーバ300からの要求に応じて操作するサーバである。
アプリケーションサーバ300は、端末装置50から受け付けた処理要求に応じてSQL文を生成し、DBサーバ200にデータベース210の操作を依頼する。アプリケーションサーバ300は、処理の役割に応じた3つの層(レイヤ)を有する。具体的には、Web層310、サービス層320およびデータアクセス層330である。
The DB server 200 is a server that operates the database 210 in response to a request from the application server 300.
The application server 300 generates an SQL statement in response to the processing request received from the terminal device 50 and requests the DB server 200 to operate the database 210. The application server 300 has three layers (layers) according to processing roles. Specifically, the Web layer 310, the service layer 320, and the data access layer 330.

Web層310は、端末装置50のブラウザを介して業務サービスに対する処理要求を受け付ける。Web層310は、Web層コンポーネント311を有する。
Web層コンポーネント311は、業務サービスの端末装置50に対するインタフェースである。Web層コンポーネント311は、端末装置50からの業務サービスに対する処理要求を受け付けてサービスクラス321に出力する。また、Web層コンポーネント311は、サービスクラス321から業務サービスに対する処理要求の結果を受け付けて端末装置50のブラウザに応答する。
The Web layer 310 receives a processing request for a business service via the browser of the terminal device 50. The web layer 310 includes a web layer component 311.
The Web layer component 311 is an interface to the business service terminal device 50. The Web layer component 311 receives a processing request for the business service from the terminal device 50 and outputs it to the service class 321. In addition, the Web layer component 311 receives the result of the processing request for the business service from the service class 321 and responds to the browser of the terminal device 50.

サービス層320は、業務ロジックを実行するための層である。サービス層320は、サービスクラス321を有する。
サービスクラス321は、Web層コンポーネント311からの業務処理要求に基づいて、業務処理を実行する。サービスクラス321は、業務処理要求に応じたテーブル操作をDAOクラス331に依頼する。また、サービスクラス321は、DAOクラス331がORMクラス332によってカプセル化したデータを受け付け、業務処理を実行する。更に、サービスクラス321は、処理後のデータをORMクラス332によってカプセル化して、DAOクラス331に出力すると共に、データベース210のテーブル操作を依頼する。
The service layer 320 is a layer for executing business logic. The service layer 320 has a service class 321.
The service class 321 executes business processing based on the business processing request from the Web layer component 311. The service class 321 requests the DAO class 331 to perform a table operation corresponding to the business process request. Also, the service class 321 receives data encapsulated by the DAO class 331 by the ORM class 332 and executes business processing. Furthermore, the service class 321 encapsulates the processed data by the ORM class 332, outputs the data to the DAO class 331, and requests a table operation of the database 210.

サービスクラス321は、例えば、上述のサンプルクラス185aに対応する。
データアクセス層330は、データベース210にアクセスするための層である。データアクセス層330は、DAOクラス331およびORMクラス332を有する。
The service class 321 corresponds to, for example, the sample class 185a described above.
The data access layer 330 is a layer for accessing the database 210. The data access layer 330 has a DAO class 331 and an ORM class 332.

DAOクラス331は、サービスクラス321からのテーブル操作依頼に基づいてデータベース210上のテーブルを操作するためのSQL文を生成し、DBサーバ200に送信する。そして、DAOクラス331は、例えば、DBサーバ200からデータの取得結果を取得すると、ORMクラス332によって取得したデータをカプセル化してサービスクラス321に出力する。   The DAO class 331 generates an SQL statement for operating a table on the database 210 based on a table operation request from the service class 321 and transmits it to the DB server 200. For example, when the DAO class 331 acquires the data acquisition result from the DB server 200, the DAO class 331 encapsulates the data acquired by the ORM class 332 and outputs it to the service class 321.

DAOクラス331は、例えば、上述のDAOクラス145aに対応する。また、ORMクラス332は、例えば、ORMクラス125aに対応する。
ここで、サービスクラス321、DAOクラス331およびORMクラス332は、コンテナ350上で実行される。
The DAO class 331 corresponds to the above-described DAO class 145a, for example. The ORM class 332 corresponds to the ORM class 125a, for example.
Here, the service class 321, the DAO class 331, and the ORM class 332 are executed on the container 350.

コンテナ350は、DIやAOPの手法を組み込んだ各クラスの実行環境である。コンテナ350は、各クラス間の関連付けを行う。コンテナ350は、必要に応じて各クラスで共通的に利用可能なコンポーネントを共通部品記憶部340から呼び出し、各クラスの呼び出し前後にその機能を付加したり、各クラスから他のクラスを参照したりすることを可能とする。例えば、コンテナ350は、サービスクラス321の実行時に、DBサーバ200との接続処理、ログ出力処理および例外処理などのコンポーネントを実行し、これらの機能をサービスクラス321に付加する。同様に、DAOクラス331の実行時に、ログ出力処理や例外処理などのコンポーネントを実行し、これらの機能をDAOクラス331に付加する。コンテナ350は、実行部195に対応する。   The container 350 is an execution environment for each class that incorporates DI and AOP techniques. The container 350 associates each class. The container 350 calls components that can be commonly used in each class from the common part storage unit 340 as needed, adds the function before and after each class is called, and references other classes from each class. It is possible to do. For example, when executing the service class 321, the container 350 executes components such as connection processing with the DB server 200, log output processing, and exception processing, and adds these functions to the service class 321. Similarly, when executing the DAO class 331, components such as log output processing and exception processing are executed, and these functions are added to the DAO class 331. The container 350 corresponds to the execution unit 195.

図35は、コンテナによるオブジェクト間の関連付けを示す図である。コンテナ350では、各オブジェクトがコンテキスト情報354に基づいて関連付けられる。例えば、コンテナ350上では、コンテキスト情報354に基づいて、オブジェクト351,352,353が生成される。そして、コンテキスト情報354に基づいて、例えば、オブジェクト351からオブジェクト352,353への参照や呼び出しが行われる。コンテキスト情報354は、コンテキストファイル175aに対応する。   FIG. 35 is a diagram illustrating association between objects by containers. In the container 350, each object is associated based on the context information 354. For example, on the container 350, objects 351, 352, and 353 are generated based on the context information 354. Based on the context information 354, for example, reference or call from the object 351 to the objects 352 and 353 is performed. The context information 354 corresponds to the context file 175a.

このようにして、サービスクラス321、DAOクラス331、ORMクラス332および共通コンポーネントのクラスの間の関連付けが行われる。
以上、説明したようにコンピュータ100によれば、データベース210に格納された複数のテーブルの情報に基づいて、各テーブルに対応するORMクラス、DAOクラスがそれぞれ自動生成される。また、生成された各クラスと各クラスで共通的に利用される共通のコンポーネントとの関連付けを定義したコンテキストファイルが自動的に生成される。このため、各クラスと共通コンポーネントとを関連付けるためのコーディングを削減することができ、DAOクラスの生成後に実行可能とするまでに要していた工数が削減される。これにより、開発者は、システム固有の業務ロジックの開発に注力することが可能となり、システム開発作業を効率的に行うことができる。
In this manner, the association among the service class 321, the DAO class 331, the ORM class 332, and the common component class is performed.
As described above, according to the computer 100, the ORM class and the DAO class corresponding to each table are automatically generated based on the information of the plurality of tables stored in the database 210. In addition, a context file that defines the association between each generated class and a common component that is commonly used in each class is automatically generated. For this reason, the coding for associating each class with the common component can be reduced, and the number of man-hours required until execution is possible after the DAO class is generated is reduced. As a result, the developer can focus on the development of business logic unique to the system, and can efficiently perform the system development work.

また、コンピュータ100は、生成したDAOクラスを利用するサンプルクラスを自動生成し、サンプルクラスをコンテキストファイルに設定する。開発者は、このサンプルクラスを利用することで、生成したDAOクラスを介したデータベース210のテーブルアクセスを伴う処理の動作確認を即座に開始することができる。   Further, the computer 100 automatically generates a sample class that uses the generated DAO class, and sets the sample class in the context file. By using this sample class, the developer can immediately start the operation confirmation of the process involving the table access of the database 210 via the generated DAO class.

[第2の実施の形態]
次に、第2の実施の形態を図面を参照して詳細に説明する。前述の第1の実施の形態との相違点を中心に説明し、同様の事項については説明を省略する。
[Second Embodiment]
Next, a second embodiment will be described in detail with reference to the drawings. Differences from the first embodiment will be mainly described, and description of similar matters will be omitted.

第1の実施の形態では、データベース210が既に構築済みの場合の例を示した。これに対し、第2の実施の形態では、データベース210に新規にテーブルを構築する場合に関して説明する。   In the first embodiment, an example in which the database 210 has already been constructed has been shown. On the other hand, in the second embodiment, a case where a new table is constructed in the database 210 will be described.

第2の実施の形態のコンピュータのハードウェア構成は、図2に示す第1の実施の形態のコンピュータ100のハードウェア構成と同一のため、説明を省略する。
図36は、第2の実施の形態のコンピュータの機能を示すブロック図である。コンピュータ100aは、ORMファイル取得部110a、ORMファイル記憶部115、DDLファイル生成部116、ORMクラス生成部120、ORMクラス記憶部125、テンプレート記憶部130、DAOクラス生成部140、DAOクラス記憶部145、クエリ記述ファイル生成部150、クエリ記述ファイル記憶部155、共通部品記憶部160、コンテキストファイル生成部170、コンテキストファイル記憶部175、サンプルクラス生成部180およびサンプルクラス記憶部185を有する。なお、ORMファイル取得部110aおよびDDLファイル生成部116以外の構成(配置部190および実行部195を含む)に関しては、第1の実施の形態のコンピュータ100の構成と同一のため、説明を省略する。
The hardware configuration of the computer according to the second embodiment is the same as the hardware configuration of the computer 100 according to the first embodiment shown in FIG.
FIG. 36 is a block diagram illustrating functions of a computer according to the second embodiment. The computer 100a includes an ORM file acquisition unit 110a, an ORM file storage unit 115, a DDL file generation unit 116, an ORM class generation unit 120, an ORM class storage unit 125, a template storage unit 130, a DAO class generation unit 140, and a DAO class storage unit 145. A query description file generation unit 150, a query description file storage unit 155, a common component storage unit 160, a context file generation unit 170, a context file storage unit 175, a sample class generation unit 180, and a sample class storage unit 185. Note that the configuration (including the placement unit 190 and the execution unit 195) other than the ORM file acquisition unit 110a and the DDL file generation unit 116 is the same as the configuration of the computer 100 of the first embodiment, and thus description thereof is omitted. .

ORMファイル取得部110aは、ORMファイル20aを取得する。ORMファイル20aは、データベース210に格納する新規テーブル毎に、開発者により予め作成される。ORMファイル取得部110aは、取得したORMファイル20aをORMファイル記憶部115に格納する。   The ORM file acquisition unit 110a acquires the ORM file 20a. The ORM file 20a is created in advance by the developer for each new table stored in the database 210. The ORM file acquisition unit 110 a stores the acquired ORM file 20 a in the ORM file storage unit 115.

DDLファイル生成部116は、ORファイル記憶部115に記憶されたORMファイルを取得する。そして、DDLファイル生成部116は、生成したDDLファイルをDBサーバ200に送信する。DBサーバ200は、取得したDDLファイルに基づいてデータベース210に新たなテーブルを構築する。DDLファイル生成部116の機能を実現するアプリケーションとして、例えば、Hibernateを用いることができる。   The DDL file generation unit 116 acquires the ORM file stored in the OR file storage unit 115. Then, the DDL file generation unit 116 transmits the generated DDL file to the DB server 200. The DB server 200 constructs a new table in the database 210 based on the acquired DDL file. For example, Hibernate can be used as an application for realizing the function of the DDL file generation unit 116.

次に、以上のような構成を備えるコンピュータ100aにおいて実行される処理の詳細を説明する。
図37は、第2の実施の形態のプログラム生成処理の手順を示すフローチャートである。以下、図37に示す処理をステップ番号に沿って説明する。
Next, details of processing executed in the computer 100a having the above configuration will be described.
FIG. 37 is a flowchart illustrating a procedure of a program generation process according to the second embodiment. In the following, the process illustrated in FIG. 37 will be described in order of step number.

[ステップS110]ORMファイル取得部110aは、ORMファイル20aを取得し、取得したORMファイル20aをORMファイル記憶部115に格納する。
[ステップS120]DDLファイル生成部116は、ORMファイル記憶部115に記憶されたORMファイル20aに基づいて、データベース210を構築するためのDDLファイルを生成する。DDLファイル生成部116は、生成したDDLファイルをDBサーバ200に出力する。なお、DBサーバ200は、このDDLファイルに基づいてデータベース210を構築する。
[Step S110] The ORM file acquisition unit 110a acquires the ORM file 20a, and stores the acquired ORM file 20a in the ORM file storage unit 115.
[Step S120] The DDL file generation unit 116 generates a DDL file for constructing the database 210 based on the ORM file 20a stored in the ORM file storage unit 115. The DDL file generation unit 116 outputs the generated DDL file to the DB server 200. The DB server 200 constructs the database 210 based on this DDL file.

[ステップS130]ORMクラス生成部120は、ORMファイル記憶部115に記憶されたORMファイル20aに基づいて、データベース210の各テーブルに値を格納または、各テーブルから値を読み出すためのORMクラスを生成する。ORMクラス生成部120は、生成したORMクラスをORMクラス記憶部125に格納する。   [Step S130] Based on the ORM file 20a stored in the ORM file storage unit 115, the ORM class generation unit 120 stores an value in each table of the database 210 or generates an ORM class for reading the value from each table. To do. The ORM class generation unit 120 stores the generated ORM class in the ORM class storage unit 125.

[ステップS140]DAOクラス生成部140は、テンプレート記憶部130に記憶されたDAOクラス用テンプレートファイル131とORMクラス記憶部125に記憶されたORMクラスの名称とに基づいて、DAOクラスを生成する。DAOクラス生成部140は、生成したDAOクラスをDAOクラス記憶部145に格納する。   [Step S140] The DAO class generation unit 140 generates a DAO class based on the DAO class template file 131 stored in the template storage unit 130 and the ORM class name stored in the ORM class storage unit 125. The DAO class generation unit 140 stores the generated DAO class in the DAO class storage unit 145.

[ステップS150]クエリ記述ファイル生成部150は、テンプレート記憶部130に記憶されたクエリ記述用テンプレートファイル132とDAOクラス記憶部145に記憶されたDAOクラスの名称とに基づいて、クエリ記述ファイルを生成する。クエリ記述ファイル生成部150は、生成したクエリ記述ファイルをクエリ記述ファイル記憶部155に格納する。   [Step S150] The query description file generation unit 150 generates a query description file based on the query description template file 132 stored in the template storage unit 130 and the DAO class name stored in the DAO class storage unit 145. To do. The query description file generation unit 150 stores the generated query description file in the query description file storage unit 155.

[ステップS160]コンテキストファイル生成部170は、テンプレート記憶部130に記憶されたコンテキスト用テンプレートファイル133とDAOクラス記憶部145に記憶されたDAOクラスの名称とに基づいて、コンテキストファイルを生成する。コンテキストファイル生成部170は、生成したコンテキストファイル記憶部175に格納する。   [Step S <b> 160] The context file generation unit 170 generates a context file based on the context template file 133 stored in the template storage unit 130 and the DAO class name stored in the DAO class storage unit 145. The context file generation unit 170 stores the generated context file storage unit 175.

[ステップS170]サンプルクラス生成部180は、テンプレート記憶部130に記憶されたサンプルクラス用テンプレートファイル134とDAOクラス記憶部145に記憶されたDAOクラスの名称とに基づいて、サンプルのサービスクラスを生成する。サンプルクラス生成部180は、生成したサービスクラスをサンプルクラス記憶部185に格納する。   [Step S170] The sample class generation unit 180 generates a sample service class based on the sample class template file 134 stored in the template storage unit 130 and the DAO class name stored in the DAO class storage unit 145. To do. The sample class generation unit 180 stores the generated service class in the sample class storage unit 185.

[ステップS180]配置部190は、コンテキストファイル記憶部175に記憶されたコンテキストファイルに基づいて、DAOクラス、サービスクラスおよび共通コンポーネントなどの各クラスをメモリ上に配置する。そして、実行部195は、コンテキストファイルに基づいて、配置部190が配置したクラス間の関連付けを行い、サンプルのサービスを実行する。   [Step S180] The arrangement unit 190 arranges each class such as a DAO class, a service class, and a common component on the memory based on the context file stored in the context file storage unit 175. Then, the execution unit 195 associates the classes arranged by the arrangement unit 190 based on the context file, and executes a sample service.

このようにして、データベース210にテーブルを構築するためのDDLファイルと共にDAOクラスやサンプルのサービスクラスなどが自動生成される。なお、上記ステップS120の処理は、ステップS130〜S170の処理と非同期で行うことも考えられる。   In this way, a DAO class, a sample service class, and the like are automatically generated together with a DDL file for constructing a table in the database 210. Note that the process in step S120 may be performed asynchronously with the processes in steps S130 to S170.

次に、上記ステップS120の処理を更に詳しく説明する。なお、ステップS130〜S180の処理の詳細は、図19で示したステップS2〜S7の処理の詳細と同一であるため、説明を省略する。   Next, the process of step S120 will be described in more detail. Note that details of the processes in steps S130 to S180 are the same as the details of the processes in steps S2 to S7 shown in FIG.

図38は、第2の実施の形態のDDLファイル生成処理の手順を示すフローチャートである。以下、図38に示す処理をステップ番号に沿って説明する。なお、以下の処理は、上記ステップS120の処理を詳細に説明したものである。   FIG. 38 is a flowchart illustrating a procedure of DDL file generation processing according to the second embodiment. In the following, the process illustrated in FIG. 38 will be described in order of step number. The following process describes the process of step S120 in detail.

[ステップS111]DDLファイル生成部116は、ORMファイル記憶部115に記憶されたDDLファイル未作成のORMファイルを読み出す。
[ステップS112]DDLファイル生成部116は、参照したORMファイルに含まれるカラムのうち、未抽出であるカラムを抽出し、そのカラムの属性情報を取得する。
[Step S <b> 111] The DDL file generation unit 116 reads the ORM file that has not been created yet and is stored in the ORM file storage unit 115.
[Step S112] The DDL file generation unit 116 extracts an unextracted column from the columns included in the referenced ORM file, and acquires attribute information of the column.

[ステップS113]DDLファイル生成部116は、参照したテーブルに含まれる全てのカラムの情報を抽出したか否かを判定する。全てのカラムの情報を抽出済みの場合、処理がステップS114に移される。未抽出のカラムの情報が存在する場合、処理がステップS112に移される。   [Step S113] The DDL file generation unit 116 determines whether information on all columns included in the referenced table has been extracted. If all the column information has been extracted, the process proceeds to step S114. If unextracted column information exists, the process proceeds to step S112.

[ステップS114]DDLファイル生成部116は、抽出したカラムの情報に基づいて、DDLファイルを生成し、DBサーバ200に送信する。
[ステップS115]DDLファイル生成部116は、ORMファイル記憶部115に記憶された全てのORMファイルに関してDDLファイルを生成済みであるか否かを判定する。全てのORMファイルに関してDDLファイルを生成済みである場合、処理が完了する。DDLファイルを未生成のORMファイルが存在する場合、処理がステップS111に移される。
[Step S114] The DDL file generation unit 116 generates a DDL file based on the extracted column information, and transmits the DDL file to the DB server 200.
[Step S115] The DDL file generation unit 116 determines whether or not DDL files have been generated for all ORM files stored in the ORM file storage unit 115. If DDL files have been generated for all ORM files, the process is completed. If there is an ORM file for which a DDL file has not been generated, the process proceeds to step S111.

このようにして、ORMファイルで定義されるテーブルのカラムが参照され、それぞれのカラムの情報が、該当のテーブルを構築するためのDDLファイルにマッピングされる。   In this way, the columns of the table defined in the ORM file are referred to, and the information of each column is mapped to the DDL file for constructing the corresponding table.

図39は、生成されたDDLファイルの例を示す図である。DDLファイル116aは、図6に示す“Grouptbl”テーブルのDDLである“grouptbl.ddl”の例を示している。DBサーバ200は、DDLファイル116aに基づいてデータベース210に“Grouptbl”テーブルを構築する。   FIG. 39 is a diagram illustrating an example of the generated DDL file. The DDL file 116a shows an example of “grouptbl.ddl” which is the DDL of the “Grouptbl” table shown in FIG. The DB server 200 constructs a “Grouptbl” table in the database 210 based on the DDL file 116a.

このように、データベース210を構築するためのDDLファイルと共にDAOクラスやサンプルのサービスクラスなどが自動生成される。これにより、第1の実施の形態で示した効果と同様の効果を得ることができる。更に、データベース210や対象のテーブルが構築されていない場合にも、データベース210の構築と共にデータベース210にアクセスするDAOクラスおよびサンプルのサービスクラスを生成することが可能となる。このため、開発者は、データベース210にテーブルを構築した直後から、データベース210のテーブルに対する操作を行うことができる。そして、サンプルのサービスクラスに基づいて、容易に他のアプリケーションを作成することができ、開発の効率を向上することができる。   As described above, the DAO class, the sample service class, and the like are automatically generated together with the DDL file for constructing the database 210. Thereby, the effect similar to the effect shown in 1st Embodiment can be acquired. Furthermore, even when the database 210 and the target table are not constructed, it is possible to generate a DAO class and a sample service class that access the database 210 together with the construction of the database 210. For this reason, the developer can perform operations on the tables in the database 210 immediately after constructing the tables in the database 210. Then, other applications can be easily created based on the sample service class, and the development efficiency can be improved.

以上、本発明のソフトウェア開発支援プログラム、ソフトウェア開発支援装置およびソフトウェア開発支援方法を図示の実施の形態に基づいて説明したが、これらに限定されるものではなく、各部の構成は同様の機能を有する任意の構成のものに置換することができる。また、他の任意の構成物や工程が付加されてもよい。更に、前述した実施の形態のうちの任意の2以上の構成(特徴)を組み合わせたものであってもよい。   The software development support program, the software development support apparatus, and the software development support method of the present invention have been described based on the illustrated embodiments. However, the present invention is not limited to these, and the configuration of each unit has similar functions. Any configuration can be substituted. Moreover, other arbitrary structures and processes may be added. Further, any two or more configurations (features) of the above-described embodiments may be combined.

なお、上記の処理機能は、コンピュータによって実現することができる。その場合、コンピュータが有すべき機能の処理内容を記述したプログラムが提供される。そのプログラムをコンピュータで実行することにより、上記処理機能がコンピュータ上で実現される。   The above processing functions can be realized by a computer. In that case, a program describing the processing contents of the functions that the computer should have is provided. By executing the program on a computer, the above processing functions are realized on the computer.

処理内容を記述したプログラムは、コンピュータで読み取り可能な記録媒体に記録しておくことができる。コンピュータで読み取り可能な記録媒体には、磁気記録装置、光ディスク、光磁気記録媒体、半導体メモリなどがある。磁気記録装置には、HDD、フレキシブルディスク(FD)、磁気テープ(MT)などがある。光ディスクには、DVD(Digital Versatile Disc)、DVD−RAM、CD−ROM(Compact Disc - Read Only Memory)、CD−R(Recordable)/RW(ReWritable)などがある。光磁気記録媒体には、MO(Magneto - Optical disk)などがある。   The program describing the processing contents can be recorded on a computer-readable recording medium. Examples of the computer-readable recording medium include a magnetic recording device, an optical disk, a magneto-optical recording medium, and a semiconductor memory. Examples of the magnetic recording device include an HDD, a flexible disk (FD), and a magnetic tape (MT). Optical disks include DVD (Digital Versatile Disc), DVD-RAM, CD-ROM (Compact Disc-Read Only Memory), CD-R (Recordable) / RW (ReWritable), and the like. Magneto-optical recording media include MO (Magneto-Optical disk).

上記プログラムを流通させる場合には、例えば、そのプログラムが記録されたDVD、CD−ROMなどの可搬型記録媒体が販売される。また、プログラムをサーバコンピュータに格納しておき、ネットワークを介して、サーバコンピュータから他のコンピュータにそのプログラムを転送することもできる。   When the program is distributed, for example, a portable recording medium such as a DVD or CD-ROM in which the program is recorded is sold. It is also possible to store the program in a server computer and transfer the program from the server computer to another computer via a network.

上記プログラムを実行するコンピュータは、例えば、可搬型記録媒体に記録されたプログラム若しくはサーバコンピュータから転送されたプログラムを、自己の記憶装置に格納する。そして、コンピュータは、自己の記憶装置からプログラムを読み取り、プログラムに従った処理を実行する。なお、コンピュータは、可搬型記録媒体から直接プログラムを読み取り、そのプログラムに従った処理を実行することもできる。また、コンピュータは、サーバコンピュータからプログラムが転送される毎に、逐次、受け取ったプログラムに従った処理を実行することもできる。   The computer that executes the program stores, for example, the program recorded on the portable recording medium or the program transferred from the server computer in its own storage device. Then, the computer reads the program from its own storage device and executes processing according to the program. The computer can also read the program directly from the portable recording medium and execute processing according to the program. In addition, each time the program is transferred from the server computer, the computer can sequentially execute processing according to the received program.

本実施の形態の概要を示す図である。It is a figure which shows the outline | summary of this Embodiment. 第1の実施の形態のコンピュータのハードウェア構成を示す図である。It is a figure which shows the hardware constitutions of the computer of 1st Embodiment. 第1の実施の形態のコンピュータの機能を示す第1のブロック図である。FIG. 3 is a first block diagram illustrating functions of a computer according to the first embodiment. 第1の実施の形態のコンピュータの機能を示す第2のブロック図である。It is a 2nd block diagram which shows the function of the computer of 1st Embodiment. DB接続情報の例を示す図である。It is a figure which shows the example of DB connection information. データベースに格納されるテーブル構造の例を示す図である。It is a figure which shows the example of the table structure stored in a database. テンプレート記憶部に格納されるファイルの例を示す図である。It is a figure which shows the example of the file stored in a template memory | storage part. DAOクラス用テンプレートファイルの例を示す図である。It is a figure which shows the example of the template file for DAO classes. クエリ記述用テンプレートファイルの例を示す図である。It is a figure which shows the example of the template file for query description. コンテキスト用テンプレートファイルの例を示す第1の図である。It is a 1st figure which shows the example of the template file for contexts. コンテキスト用テンプレートファイルの例を示す第2の図である。It is a 2nd figure which shows the example of the template file for contexts. コンテキスト用テンプレートファイルの例を示す第3の図である。It is a 3rd figure which shows the example of the template file for contexts. コンテキスト用テンプレートファイルの例を示す第4の図である。It is a 4th figure which shows the example of the template file for contexts. コンテキスト用テンプレートファイルの例を示す第5の図である。It is a 5th figure which shows the example of the template file for contexts. サンプルクラス用テンプレートファイルの例を示す図である。It is a figure which shows the example of the template file for sample classes. 共通部品記憶部に格納されるファイルの例を示す図である。It is a figure which shows the example of the file stored in a common components memory | storage part. 汎用DAOクラスの例を示す図である。It is a figure which shows the example of a general purpose DAO class. 第1の実施の形態のプログラム生成処理の手順を示すフローチャートである。It is a flowchart which shows the procedure of the program production | generation process of 1st Embodiment. 第1の実施の形態のORMファイル生成処理の手順を示すフローチャートである。It is a flowchart which shows the procedure of the ORM file production | generation process of 1st Embodiment. 第1の実施の形態のORMクラス生成処理の手順を示すフローチャートである。It is a flowchart which shows the procedure of the ORM class production | generation process of 1st Embodiment. 第1の実施の形態のDAOクラス生成処理の手順を示すフローチャートである。It is a flowchart which shows the procedure of the DAO class production | generation process of 1st Embodiment. 第1の実施の形態のクエリ記述ファイル生成処理の手順を示すフローチャートである。It is a flowchart which shows the procedure of the query description file production | generation process of 1st Embodiment. 第1の実施の形態のコンテキストファイル生成処理の手順を示すフローチャートである。It is a flowchart which shows the procedure of the context file production | generation process of 1st Embodiment. 第1の実施の形態のサンプルアプリケーション生成処理の手順を示すフローチャートである。It is a flowchart which shows the procedure of the sample application production | generation process of 1st Embodiment. 第1の実施の形態のサンプルアプリケーション実行処理の手順を示すフローチャートである。It is a flowchart which shows the procedure of the sample application execution process of 1st Embodiment. テンプレートから生成されるファイルの一覧の例を示す図である。It is a figure which shows the example of the list of the files produced | generated from a template. 生成されたORMファイルの例を示す図である。It is a figure which shows the example of the produced | generated ORM file. 生成されたORMクラスの例を示す図である。It is a figure which shows the example of the produced | generated ORM class. 生成されたDAOクラスの例を示す図である。It is a figure which shows the example of the produced | generated DAO class. 生成されたクエリ記述ファイルの例を示す図である。It is a figure which shows the example of the produced | generated query description file. 生成されたコンテキストファイルの例を示す第1の図である。It is a 1st figure which shows the example of the produced | generated context file. 生成されたコンテキストファイルの例を示す第2の図である。It is a 2nd figure which shows the example of the produced | generated context file. 生成されたサンプルクラスの例を示す図である。It is a figure which shows the example of the produced | generated sample class. Webシステムの構成を示す図である。It is a figure which shows the structure of a Web system. コンテナによるオブジェクト間の関連付けを示す図である。It is a figure which shows the correlation between the objects by a container. 第2の実施の形態のコンピュータの機能を示すブロック図である。It is a block diagram which shows the function of the computer of 2nd Embodiment. 第2の実施の形態のプログラム生成処理の手順を示すフローチャートである。It is a flowchart which shows the procedure of the program production | generation process of 2nd Embodiment. 第2の実施の形態のDDLファイル生成処理の手順を示すフローチャートである。It is a flowchart which shows the procedure of the DDL file generation process of 2nd Embodiment. 生成されたDDLファイルの例を示す図である。It is a figure which shows the example of the produced | generated DDL file.

符号の説明Explanation of symbols

1 コンピュータ
1a データアクセス部品生成手段
1b 共通部品記憶手段
1c 登録情報生成手段
2 データベース
2a,2b,2c テーブル
3 登録情報
4 プログラム実行環境
4a,4b,4c データアクセス部品
4d 共通部品
DESCRIPTION OF SYMBOLS 1 Computer 1a Data access component production | generation means 1b Common component memory | storage means 1c Registration information production | generation means 2 Database 2a, 2b, 2c Table 3 Registration information 4 Program execution environment 4a, 4b, 4c Data access component 4d Common component

Claims (9)

コンピュータを、
データベースに格納された複数のテーブルの情報に基づいて、前記複数のテーブルそれぞれについて、アクセス要求を受け付けて当該テーブルに対し所定の操作を行うプログラム部品であるデータアクセス部品を生成するデータアクセス部品生成手段、
前記データアクセス部品に対して前記アクセス要求を行うアプリケーションプログラムを生成するアプリケーション生成手段、
前記所定の操作に伴って実行させる複数の前記データアクセス部品の間で共通の処理を定義した共通部品を記憶する共通部品記憶手段、
前記データアクセス部品生成手段が生成した前記データアクセス部品をプログラム実行環境に登録するための情報と、前記共通部品記憶手段に記憶された前記共通部品で定義された処理が前記データアクセス部品による前記所定の操作の際に前記プログラム実行環境上で実行されるようにするための情報と、前記アプリケーション生成手段が生成した前記アプリケーションプログラムを前記データアクセス部品に関連付けて前記プログラム実行環境に登録するための情報とを含む登録情報を生成する登録情報生成手段、
として機能させることを特徴とするソフトウェア開発支援プログラム。
Computer
Data access component generation means for generating a data access component that is a program component that receives an access request and performs a predetermined operation on the table for each of the plurality of tables based on information of the plurality of tables stored in the database ,
Application generation means for generating an application program for making the access request to the data access component;
Common component storage means for storing a common component defining a common process among the plurality of data access components to be executed in accordance with the predetermined operation;
Information for registering the data access component generated by the data access component generation unit in a program execution environment and processing defined by the common component stored in the common component storage unit are performed by the data access component. Information for execution on the program execution environment during the operation of the information, and information for registering the application program generated by the application generation means in the program execution environment in association with the data access component Registration information generating means for generating registration information including:
Software development support program characterized by functioning as
前記コンピュータを、更に、データ型をパラメタ化して前記所定の操作を定義した汎用データアクセス部品を記憶する汎用部品記憶手段として機能させ、
前記データアクセス部品生成手段が生成する前記データアクセス部品は、前記汎用部品記憶手段に記憶された前記汎用データアクセス部品を、前記テーブルに応じたデータ型を前記パラメタとして指定して利用するプログラム部品である、
ことを特徴とする請求項1記載のソフトウェア開発支援プログラム。
The computer further functions as a general-purpose component storage means for storing a general-purpose data access component that defines the predetermined operation by parameterizing a data type,
The data access component generated by the data access component generation unit is a program component that uses the general-purpose data access component stored in the general-purpose component storage unit by designating a data type corresponding to the table as the parameter. is there,
The software development support program according to claim 1.
前記コンピュータを、更に、前記汎用データアクセス部品で定義された前記所定の操作以外の操作を記述するためのクエリ文書を生成するクエリ文書生成手段として機能させ、
前記登録情報生成手段は、生成する前記登録情報に、前記クエリ文書生成手段が生成した前記クエリ文書に記述された操作を前記プログラム実行環境上で実行可能にするための情報を含める、
ことを特徴とする請求項2記載のソフトウェア開発支援プログラム。
The computer is further caused to function as a query document generation unit that generates a query document for describing an operation other than the predetermined operation defined in the general-purpose data access component.
The registration information generation means includes information for enabling the operation described in the query document generated by the query document generation means to be executed on the program execution environment in the registration information to be generated.
The software development support program according to claim 2.
前記コンピュータを、更に、前記複数のテーブルそれぞれについて、前記アクセス要求を行うアプリケーションプログラムが使用するデータのデータ型と前記テーブルに含まれるデータのデータ型とを対応付けたマッピング情報を生成するマッピング情報生成手段として機能させ、
前記登録情報生成手段は、生成する前記登録情報に、前記マッピング情報生成手段が生成した前記マッピング情報に基づいて前記データアクセス部品による前記所定の操作が実行されるようにするための情報を含める、
ことを特徴とする請求項1記載のソフトウェア開発支援プログラム。
The computer further generates mapping information for each of the plurality of tables to generate mapping information that associates the data type of the data used by the application program making the access request with the data type of the data included in the table. Function as a means,
The registration information generation means includes information for causing the predetermined operation by the data access component to be executed based on the mapping information generated by the mapping information generation means in the registration information to be generated.
The software development support program according to claim 1.
前記コンピュータを、更に、前記データベースと接続するための接続情報を受け付け、前記データベースに接続して前記複数のテーブルの情報を取得するテーブル情報取得手段として機能させ、  The computer further receives connection information for connecting to the database, and functions as table information acquisition means for acquiring information of the plurality of tables by connecting to the database,
前記データアクセス部品生成手段は、前記テーブル情報取得手段が取得した前記複数のテーブルの情報に基づいて、前記データアクセス部品を生成する、  The data access component generation unit generates the data access component based on the information of the plurality of tables acquired by the table information acquisition unit.
ことを特徴とする請求項1記載のソフトウェア開発支援プログラム。  The software development support program according to claim 1.
前記コンピュータを、更に、  Said computer further
前記複数のテーブルそれぞれについて、前記アクセス要求を行うアプリケーションプログラムが使用するデータのデータ型と前記テーブルに含まれるデータのデータ型とを対応付けたマッピング情報を取得するマッピング情報取得手段、  Mapping information acquisition means for acquiring mapping information that associates the data type of the data used by the application program that makes the access request with the data type of the data included in the table for each of the plurality of tables.
前記マッピング情報取得手段が取得した前記マッピング情報に基づいて、前記データベースにテーブルを構築するためのテーブル定義情報を生成して、前記データベースに出力するテーブル定義情報生成手段、  Table definition information generating means for generating table definition information for constructing a table in the database based on the mapping information acquired by the mapping information acquiring means, and outputting the table definition information to the database;
として機能させ、  Function as
前記データアクセス部品生成手段は、前記マッピング情報取得手段が取得した複数の前記マッピング情報に基づいて、前記データアクセス部品を生成する、  The data access component generation unit generates the data access component based on a plurality of the mapping information acquired by the mapping information acquisition unit.
ことを特徴とする請求項1記載のソフトウェア開発支援プログラム。  The software development support program according to claim 1.
前記共通部品記憶手段に記憶された前記共通部品は、前記データベースとのコネクションの管理、トランザクション管理、ログ出力および例外処理のうち少なくとも1つの処理を定義していることを特徴とする請求項1記載のソフトウェア開発支援プログラム。  2. The common component stored in the common component storage means defines at least one of management of connection with the database, transaction management, log output, and exception processing. Software development support program. データベースに格納された複数のテーブルの情報に基づいて、前記複数のテーブルそれぞれについて、アクセス要求を受け付けて当該テーブルに対し所定の操作を行うプログラム部品であるデータアクセス部品を生成するデータアクセス部品生成手段と、
前記データアクセス部品に対して前記アクセス要求を行うアプリケーションプログラムを生成するアプリケーション生成手段と、
前記所定の操作に伴って実行させる複数の前記データアクセス部品の間で共通の処理を定義した共通部品を記憶する共通部品記憶手段と、
前記データアクセス部品生成手段が生成した前記データアクセス部品をプログラム実行環境に登録するための情報と、前記共通部品記憶手段に記憶された前記共通部品で定義された処理が前記データアクセス部品による前記所定の操作の際に前記プログラム実行環境上で実行されるようにするための情報と、前記アプリケーション生成手段が生成した前記アプリケーションプログラムを前記データアクセス部品に関連付けて前記プログラム実行環境に登録するための情報とを含む登録情報を生成する登録情報生成手段と、
を有することを特徴とするソフトウェア開発支援装置。
Data access component generation means for generating a data access component that is a program component that receives an access request and performs a predetermined operation on the table for each of the plurality of tables based on information of the plurality of tables stored in the database When,
Application generation means for generating an application program for making the access request to the data access component;
A common component storage unit that stores a common component that defines a common process among the plurality of data access components to be executed in accordance with the predetermined operation;
Information for registering the data access component generated by the data access component generation unit in a program execution environment and processing defined by the common component stored in the common component storage unit are performed by the data access component. Information for execution on the program execution environment during the operation of the information, and information for registering the application program generated by the application generation means in the program execution environment in association with the data access component Registration information generating means for generating registration information including:
A software development support apparatus characterized by comprising:
コンピュータが、
データベースに格納された複数のテーブルの情報に基づいて、前記複数のテーブルそれぞれについて、アクセス要求を受け付けて当該テーブルに対し所定の操作を行うプログラム部品であるデータアクセス部品を生成し、
前記データアクセス部品に対して前記アクセス要求を行うアプリケーションプログラムを生成し、
生成された前記データアクセス部品をプログラム実行環境に登録するための情報と、前記所定の操作に伴って実行させる複数の前記データアクセス部品の間で共通の処理であって共通部品記憶手段に記憶された共通部品で定義された処理が、前記データアクセス部品による前記所定の操作の際に前記プログラム実行環境上で実行されるようにするための情報と、生成された前記アプリケーションプログラムを前記データアクセス部品に関連付けて前記プログラム実行環境に登録するための情報とを含む登録情報を生成する、
ことを特徴とするソフトウェア開発支援方法。
Computer
Based on information of a plurality of tables stored in the database, for each of the plurality of tables, a data access component that is a program component that receives an access request and performs a predetermined operation on the table is generated,
Generating an application program for making the access request to the data access component;
Information for registering the generated data access component in the program execution environment and a process common to the plurality of data access components to be executed in accordance with the predetermined operation and stored in the common component storage means Information for causing the processing defined by the common component to be executed on the program execution environment during the predetermined operation by the data access component, and the generated application program as the data access component Generating registration information including information for registering in the program execution environment in association with
A software development support method characterized by the above.
JP2008249924A 2008-09-29 2008-09-29 Software development support program, software development support apparatus, and software development support method Expired - Fee Related JP5237030B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2008249924A JP5237030B2 (en) 2008-09-29 2008-09-29 Software development support program, software development support apparatus, and software development support method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2008249924A JP5237030B2 (en) 2008-09-29 2008-09-29 Software development support program, software development support apparatus, and software development support method

Publications (2)

Publication Number Publication Date
JP2010079803A JP2010079803A (en) 2010-04-08
JP5237030B2 true JP5237030B2 (en) 2013-07-17

Family

ID=42210137

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2008249924A Expired - Fee Related JP5237030B2 (en) 2008-09-29 2008-09-29 Software development support program, software development support apparatus, and software development support method

Country Status (1)

Country Link
JP (1) JP5237030B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102015980B1 (en) * 2018-11-14 2019-08-29 한국과학기술정보연구원 computational science and engineering platform simulation method and system for connecting pre-processing unit and post-processing unit thereto

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5675666B2 (en) * 2012-02-09 2015-02-25 株式会社野村総合研究所 Timed data history management system

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003186670A (en) * 2001-12-21 2003-07-04 Hitachi Information Systems Ltd Automatic generation device, automatic generation method and automatic generation program for database access component
JP2004252536A (en) * 2003-02-18 2004-09-09 Fujitsu Ltd Program development support device
JP2005275913A (en) * 2004-03-25 2005-10-06 Mitsubishi Electric Corp Information processing system, program for acquiring data, program creating method and data providing method
JP2006268124A (en) * 2005-03-22 2006-10-05 Fuji Electric Systems Co Ltd Automatic creation system and program

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102015980B1 (en) * 2018-11-14 2019-08-29 한국과학기술정보연구원 computational science and engineering platform simulation method and system for connecting pre-processing unit and post-processing unit thereto

Also Published As

Publication number Publication date
JP2010079803A (en) 2010-04-08

Similar Documents

Publication Publication Date Title
CN101454779B (en) Search-based application development framework
US6920456B2 (en) Method, system, and program for maintaining information in database tables and performing operations on data in the database tables
JP5162094B2 (en) Method and apparatus for metadata-driven business logic processing
JP3437849B2 (en) Database management system and method for supporting object-oriented programming
US6785882B1 (en) Process-driven tool interface for an object management system
US7165073B2 (en) Dynamic, hierarchical data exchange system
US5418957A (en) Network data dictionary
US5758351A (en) System and method for the creation and use of surrogate information system objects
US9886245B2 (en) Software development tool using a workflow pattern that describes software applications
US7559052B2 (en) Meta-model for associating multiple physical representations of logically equivalent entities in messaging and other applications
JP2001282594A (en) Corporate work integration system and method for integrating a plurality of data sources
KR20060045622A (en) Extraction, transformation and loading designer module of a computerized financial system
US8881127B2 (en) Systems and methods to automatically generate classes from API source code
US20100312592A1 (en) Confirming enforcement of business rules specified in a data access tier of a multi-tier application
US20080263142A1 (en) Meta Data Driven User Interface System and Method
WO2011116471A1 (en) Method and system for generating updated test data
US8433729B2 (en) Method and system for automatically generating a communication interface
EP2718841A2 (en) Code generation and implementation method, system, and storage medium for delivering bidirectional data aggregation and updates
US20080263018A1 (en) Method and System for Mapping Business Objects to Relational Database Tables
JP5237030B2 (en) Software development support program, software development support apparatus, and software development support method
US20060047710A1 (en) Globalized database system and method for accessing the same
US20070094289A1 (en) Dynamic, hierarchical data exchange system
US20060190476A1 (en) Database storage system and associated method
US20020019824A1 (en) Method to generically describe and manipulate arbitrary data structures
CN101419611A (en) Method for performing an operation on an XML database

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20110329

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20120822

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20120828

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20121029

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20121127

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20130128

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: 20130312

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20130328

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

Ref document number: 5237030

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20160405

Year of fee payment: 3

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

LAPS Cancellation because of no payment of annual fees