JP2007011586A - Method for managing message resource for software - Google Patents

Method for managing message resource for software Download PDF

Info

Publication number
JP2007011586A
JP2007011586A JP2005190002A JP2005190002A JP2007011586A JP 2007011586 A JP2007011586 A JP 2007011586A JP 2005190002 A JP2005190002 A JP 2005190002A JP 2005190002 A JP2005190002 A JP 2005190002A JP 2007011586 A JP2007011586 A JP 2007011586A
Authority
JP
Japan
Prior art keywords
message
file
document
resource
program
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2005190002A
Other languages
Japanese (ja)
Inventor
Shigehiro Yamamoto
繁弘 山本
Taketo Hashimoto
武人 橋本
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hitachi Software Engineering Co Ltd
Original Assignee
Hitachi Software Engineering Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hitachi Software Engineering Co Ltd filed Critical Hitachi Software Engineering Co Ltd
Priority to JP2005190002A priority Critical patent/JP2007011586A/en
Publication of JP2007011586A publication Critical patent/JP2007011586A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)
  • Stored Programmes (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To eliminate inconsistencies due to, for example, failures to add messages to a document or correct them. <P>SOLUTION: A message resource management system 200 (enclosed by broken lines) has a message class generation device 201 and a message document generation device 202. A message resource definition file 203 is provided as a file for storing information on message resources. The message resource definition file 203 is written in XML format, and the used programming language is Java (R). The message class generation device 201 reads in the information in the message resource definition file 203 to generate a message management class 204 for managing common parts of message management as templates. The message document generation device 202 reads in the information in the message resource definition file 203 defining the message resources to generate a message document 205. <P>COPYRIGHT: (C)2007,JPO&INPIT

Description

本発明は、ソフトウェアのメッセージ資源の管理方法に関する。   The present invention relates to a software message resource management method.

プログラム実行の際、例えばエラー発生時などに表示画面やファイル等の出力装置に出力するメッセージは、プログラム中にそのメッセージ内容を直接記述してしまうと、後からメッセージを変更する場合にプログラムまで書き換える必要があるなどメッセージの管理が難しくなる。すなわち、ソフトウェア製品で使用するメッセージは、通常、機能仕様書やマニュアルに一覧を記載する必要があるため、同一内容のメッセージは同一のIDにより管理する。メッセージ内容を修正する場合には、プログラム中で使用している同一IDのメッセージを全て修正しなければならない。プログラム中にメッセージを直接記述した場合には、修正箇所を検索する手間を要する上に、同一のIDのメッセージの内容が異なっていないかどうかに関するチェックも行う必要がある。特に、大規模なソフトウェアの場合には、プログラム中で使用しているメッセージを全て調査し、ドキュメントに漏れなく記載すると膨大な作業量となる。   When executing a program, for example, if a message is output to an output device such as a display screen or a file when an error occurs, if the message content is described directly in the program, the program will be rewritten if the message is changed later. It becomes difficult to manage messages such as necessity. That is, since messages used in software products usually need to be listed in a functional specification or manual, messages having the same contents are managed by the same ID. When modifying the message contents, all messages with the same ID used in the program must be modified. When the message is directly described in the program, it is necessary to search for a correction location and to check whether the content of the message with the same ID is different. In particular, in the case of large-scale software, if all messages used in the program are investigated and written in the document without omission, a huge amount of work is required.

そこで、メッセージ資源をプログラムの外部に配置するメッセージ資源の外部化ということが考えられている。メッセージ資源の外部化に関する従来例としては、下記特許文献1に記載の技術が知られている。特許文献1には具体的な方法は言及されていないが、一般的には、まず、出力するメッセージを、ファイル名等の可変要素と、可変要素を埋め込む位置に特定の記号を挿入したメッセージテンプレートと、に分解する。ソースファイルとは別のファイルに、一連のメッセージテンプレートとそれに対応するキーを記述しておき、プログラム側でキーを指定してメッセージテンプレートを取り出すようにする。そして、メッセージテンプレートと埋字のリストから、プログラムの実行時にメッセージを組み立てるようにする。   Therefore, it is considered to externalize the message resource in which the message resource is arranged outside the program. As a conventional example relating to externalization of message resources, a technique described in Patent Document 1 below is known. Although a specific method is not described in Patent Document 1, generally, first, a message template in which a variable element such as a file name and a specific symbol are inserted at a position where the variable element is embedded is output. And decompose. A series of message templates and corresponding keys are described in a file different from the source file, and the message template is extracted by designating the key on the program side. Then, the message is assembled from the message template and the list of embedded characters when the program is executed.

システムによっては、特にメッセージ資源の国際化という観点から、メッセージ資源の外部化を補助するライブラリが提供されている場合がある。例えば、Java言語の場合、リソースバンドルと呼ぶ機構が用意されている。   Depending on the system, a library for assisting externalization of message resources may be provided, particularly from the viewpoint of internationalization of message resources. For example, in the case of Java language, a mechanism called resource bundle is prepared.

図1はリソースバンドルを使用したメッセージ管理の例を示す図である。「キー = メッセージテンプレート」の形式で、プログラムで使うメッセージファイルであるプロパティファイル100を作成しておき、ソースファイル110でID001などのキーを指定することにより、キーに対応するメッセージテンプレート、例えば、「ID001={0}のファイルでI/Oエラーが発生しました。」などのメッセージを取得する。ドキュメント120は、プロパティファイル100に基づいて手動で生成される(130)。そのため、人為的なミスは避けがたく、例えばドキュメントファイル120にメッセージを追加するのを忘れたり、ドキュメントファイル120とプログラムの出力結果とが異なったりする可能性もある。尚、ドキュメントファイル120とプログラムとの同期については、下記特許文献2に記載されている。   FIG. 1 is a diagram illustrating an example of message management using resource bundles. A property file 100, which is a message file used in a program, is created in the format of “key = message template”, and a key such as ID001 is designated in the source file 110, whereby a message template corresponding to the key, for example, “ A message such as “An I / O error has occurred in the file with ID001 = {0}” is acquired. The document 120 is manually generated based on the property file 100 (130). For this reason, human error is unavoidable. For example, it is possible to forget to add a message to the document file 120, or the document file 120 and the output result of the program may be different. The synchronization between the document file 120 and the program is described in Patent Document 2 below.

特開平7−182149号公報JP 7-182149 A 特開平6−139055号公報Japanese Patent Laid-Open No. 6-139055

図1に示すように、メッセージ資源をソースファイル110から切離して外部ファイル(プロパティファイル)100に記述した場合に、プログラム中で特定のメッセージを取り出すためには、当該メッセージに対応付けられたキー値(例えば、“ID001”)を矢印で示すように指定する必要がある。前述のリソースバンドルでは、プロパティファイル100に記述したキー値“ID001”を指定してメッセージ資源「{0}のファイルでI/Oエラーが発生しました。」を取得する。C言語にもUNIXのメッセージカタログという機構があるが、同様にプログラム中で文字列を指定してメッセージ資源を取得する。   As shown in FIG. 1, when a message resource is separated from a source file 110 and described in an external file (property file) 100, a key value associated with the message is used to extract a specific message in the program. (For example, “ID001”) needs to be designated as indicated by an arrow. In the above-mentioned resource bundle, the key value “ID001” described in the property file 100 is specified, and the message resource “I / O error has occurred in the file of {0}” is acquired. The C language also has a UNIX message catalog mechanism. Similarly, a message resource is specified by specifying a character string in the program.

ところで、メッセージ資源を取得するためのキー値として誤った値(文字列)、例えば、“ID01”を指定してしまったと仮定する。このような誤りがあった場合でも、文字列としては構文的には間違っていないため、機械語に翻訳する際にコンパイルエラーとはならない。従って、機械語に翻訳した後になって、実際にプログラムを実行して当該メッセージの取得処理に到達した段階においてリソースが取得できない旨のエラーが発生し、初めて指定間違であったことが発見されることになる。   By the way, it is assumed that an incorrect value (character string), for example, “ID01” is specified as a key value for acquiring a message resource. Even if there is such an error, it is not syntactically wrong as a character string, so it does not cause a compile error when translated into machine language. Therefore, after translation into machine language, it was discovered that an error occurred indicating that resources could not be acquired when the program was actually executed and the message acquisition process was reached, and it was the first time that the specification was incorrect. Will be.

また、メッセージテンプレートと埋字リストとからメッセージを作成した場合には、通常、Java言語のMessageFormatやC言語のsprintfなどの標準ライブラリが使用される。   When a message is created from a message template and an embedded list, a standard library such as Java MessageFormat or C language sprintf is usually used.

これらは、メッセージテンプレート中の埋字の数と与えられた引数の数とに関するチェック機能がなく、指定する引数の数や型を間違えた場合には、コンパイルエラーにはならない。従って、意図しないメッセージが作成されることになりかねない。仮にメッセージの組立時に埋字と引数の数とをチェックするルーチンを作成したとしても、プログラムによる処理の実行時にならないとチェックされない。   These do not have a check function for the number of embedded characters in the message template and the number of given arguments, and will not cause a compilation error if the number or type of the specified arguments are incorrect. Therefore, an unintended message may be created. Even if a routine for checking the number of embedded characters and the number of arguments at the time of assembling a message is created, the routine is not checked unless the processing is executed by a program.

異常系のエラーメッセージの場合には、マシンテストによって実行するのが困難な状況もあり、メッセージの不良を作り込んだまま見逃す可能性もある。   In the case of an abnormal error message, there are situations where it is difficult to execute by a machine test, and there is a possibility of overlooking the message with a built-in defect.

上記特許文献1は、プログラムとは別に、動作ごとに定義したメッセージを対話的に追加・変更することを目的としており、メッセージ構築に関する不良をコンパイル時に検出することができない。上記特許文献2は、プログラム資源とドキュメントとを、それぞれリビジョンで管理し、リビジョンのチェックによって同期化する方式を記載しており、本発明の手法とは異なる。   The above-mentioned patent document 1 aims to interactively add / change a message defined for each operation separately from a program, and cannot detect a failure related to message construction at the time of compilation. The above-mentioned patent document 2 describes a method in which program resources and documents are managed by revisions and synchronized by revision check, which is different from the method of the present invention.

本発明は、メッセージ資源の情報を特定のフォーマットのメッセージ資源定義ファイルで管理し、メッセージ構築に関する不良をプログラム実行前(コンパイル時)に検出することを目的とする。   An object of the present invention is to manage message resource information with a message resource definition file of a specific format, and to detect a failure related to message construction before executing a program (during compilation).

また、本発明は、ドキュメントへのメッセージの追加・修正漏れ等による不一致が生じなくなるようにすることを目的とする。   It is another object of the present invention to prevent inconsistency due to a lack of addition / correction of a message to a document.

本発明ではメッセージ資源の情報をメッセージ資源定義ファイルに記述し、このファイルからメッセージ管理クラスを生成する装置およびメッセージドキュメントを自動生成する装置を設ける。   In the present invention, message resource information is described in a message resource definition file, and a device for generating a message management class from this file and a device for automatically generating a message document are provided.

メッセージ管理クラスは、従来手法での、メッセージテンプレートのキーの記述ミスおよび埋字の指定ミスを、コンパイル時に検出できるようにする機構である。メッセージ管理クラスでは、一つのメッセージに対応した一つのメソッドとして作成される。すなわち、メッセージの取得を、「文字列」によるキーではなく、メッセージ毎に自動生成された「メソッド」で行う。文字列の場合は、”xxx”を”xx”とミスしても構文的には正しいが、メソッドxxx()をxx()とミスした場合、「xx()というメソッドは定義されていない」という構文エラーになる。   The message management class is a mechanism that makes it possible to detect a mistake in the description of the key of the message template and a mistake in the designation of the embedded character in the conventional method at the time of compilation. In the message management class, it is created as one method corresponding to one message. In other words, the message is acquired not by the key based on the “character string” but by the “method” automatically generated for each message. In the case of a character string, even if “xxx” is missed as “xx”, it is syntactically correct. However, when the method xxx () is missed as xx (), “the method xx () is not defined” Results in a syntax error.

また、メッセージの埋字はメソッドの引数に対応させる。従来のObject型の配列では、new Object[] {file, name}と指定するべきところを、例えばnew Object[] {file}などとミスしてもエラーにはならないが、メソッドの引数の場合、xxx(file, name)をxxx(file)と誤って指定すると、コンパイルエラーになる。   In addition, the padding of the message corresponds to the method argument. In the conventional Object type array, it is not an error if a place where new Object [] {file, name} should be specified, for example, new Object [] {file}, is not an error. If xxx (file, name) is incorrectly specified as xxx (file), a compilation error occurs.

本発明によれば、プログラムの外部に記述されたメッセージ資源をプログラム中から呼び出す際、メッセージ管理クラスでは、一つのメッセージに対応した一つのメソッドとして作成されるため、メッセージを間違えた場合にはコンパイル時にエラーになる。また、メッセージの埋字をメソッドの引数に対応させることで、メッセージの呼出において、メソッドの名前、引数の数、引数の型のすべてが一致していなければ、コンパイルエラーとなる。   According to the present invention, when a message resource described outside the program is called from within the program, the message management class is created as one method corresponding to one message. Sometimes an error occurs. Also, by matching the message padding to the method arguments, a compile error will occur if the method name, number of arguments, and argument types do not all match in the message call.

そのため、メッセージの不良をプログラムの実行前に検出することができるという利点がある。また、同一のメッセージ資源から、プログラムのメッセージ管理クラスとドキュメントとを自動生成するため、ドキュメントへのメッセージの追加・修正漏れ等による不一致がなくなるという利点がある。   Therefore, there is an advantage that a defective message can be detected before the program is executed. Further, since the message management class of the program and the document are automatically generated from the same message resource, there is an advantage that there is no inconsistency due to the addition or correction omission of the message to the document.

以下、本発明の一実施の形態によるソフトウェアのメッセージ資源管理技術について図面を参照して説明する。図2は、本実施の形態によるメッセージ資源管理システムの一構成例を示す機能ブロック図である。図2に示すように、本実施の形態によるメッセージ資源管理システム200(破線で囲まれた構成)は、メッセージクラス生成装置201と、メッセージドキュメント生成装置202と、を有している。メッセージ資源の情報を格納するファイルとして、後述するメッセージ資源定義ファイル203を有する。本実施の形態では、メッセージ資源定義ファイル203をXML形式で記載し、プログラム言語としてJavaを用いた場合を例にして以下に説明する。   A software message resource management technique according to an embodiment of the present invention will be described below with reference to the drawings. FIG. 2 is a functional block diagram showing a configuration example of the message resource management system according to the present embodiment. As shown in FIG. 2, the message resource management system 200 (configuration surrounded by a broken line) according to the present embodiment includes a message class generation device 201 and a message document generation device 202. As a file for storing message resource information, a message resource definition file 203 described later is included. In the present embodiment, the message resource definition file 203 is described in the XML format, and a case where Java is used as a program language will be described below as an example.

メッセージクラス生成装置201は、後述する図3に示すメッセージ資源定義ファイル203の情報を読み込み、メッセージを管理する共通部分を雛形(テンプレート)として管理するメッセージ管理クラス204を生成する。メッセージドキュメント生成装置202は、メッセージ資源を定義するメッセージ資源定義ファイル203の情報を読み込み、メッセージドキュメント205を生成する。   The message class generation device 201 reads information in a message resource definition file 203 shown in FIG. 3 to be described later, and generates a message management class 204 that manages a common part for managing messages as a template (template). The message document generation device 202 reads information in the message resource definition file 203 that defines message resources, and generates a message document 205.

本実施の形態によるメッセージ資源管理システム200に関連して、プログラム格納部211と、処理系212と、実行ファイル格納部213と、I/O214と、が設けられ、I/O214から、ファイル215aとして、又はCRTなどの表示部215bに表示されることでプログラムの実行結果が表示・出力される。   In relation to the message resource management system 200 according to the present embodiment, a program storage unit 211, a processing system 212, an execution file storage unit 213, and an I / O 214 are provided, and from the I / O 214 as a file 215a. Alternatively, the execution result of the program is displayed / outputted by being displayed on the display unit 215b such as a CRT.

ここで、上記メッセージ資源定義ファイル203をXML形式で記述した内容例について説明する。図3は、作成者が、例えば手書きで作成したメッセージ資源定義ファイル203の記述例を示した図である。図3において、要素301は、IDをキーにした1つのメッセージを表す要素である。1つのメッセージ毎に要素301を記述する。要素301の属性としてメッセージID(ここでは、「ID001」)を指定しておく。要素302には、メッセージテンプレート(ここでは、「{0}のファイルでI/Oエラーが発生しました。{1}」)を記述する。要素303は、上記{0}、{1}のように順番に記載されている埋め字の解説であり、{0}:ファイル名、{1}:エラー内容などの埋字の説明するメッセージが記述されている。要素304には、上記メッセージが発生する発生要因(cause)を記述する。例えば、「ファイルの操作でエラーが発生しました。」などの記述がなされる。要素305には、上記メッセージが発生した場合の対処方法(solution)が必要な場合には、それを記述する。例えば、「ファイルの状態を確認してください。」などの記述がなされる。   Here, an example of contents in which the message resource definition file 203 is described in the XML format will be described. FIG. 3 is a diagram showing a description example of the message resource definition file 203 created by the creator, for example, by handwriting. In FIG. 3, an element 301 is an element that represents one message with the ID as a key. An element 301 is described for each message. A message ID (here, “ID001”) is designated as an attribute of the element 301. An element 302 describes a message template (here, “I / O error occurred in file {0}. {1}”). The element 303 is a description of the embedded characters described in order such as {0} and {1}, and a message explaining the embedded characters such as {0}: file name, {1}: error content, etc. is described. An element 304 describes a cause of occurrence of the message. For example, a description such as “An error occurred during file operation” is made. An element 305 describes a solution (solution) when the message is generated, if necessary. For example, a description such as “Check the status of the file” is made.

要素306には、メッセージに対応し、呼び出されることで作成したメッセージを返却するメソッドに関する情報を記述する。要素306の属性には、例えば、「ioError」などの、作成するメソッド名が指定されている。要素307には、作成するメソッドの引数に関する情報を記述する。要素307の属性には、引数の型308、引数名309、引数コメント310がそれぞれ指定されている。このように、メッセージ資源定義ファイルには、ID001に関連する情報を全て記載し、かつ、例えばXMLで記述する。   In an element 306, information related to a message and a method for returning a message created by being called is described. In the attribute of the element 306, for example, a method name to be created such as “ioError” is specified. An element 307 describes information related to the argument of the method to be created. As the attributes of the element 307, an argument type 308, an argument name 309, and an argument comment 310 are specified. In this way, the message resource definition file describes all information related to ID001, and is described in XML, for example.

図4は、図2に示すメッセージクラス生成装置201が後述するメッセージ管理クラス600を自動作成する手順を示すフローチャート図である。図6は、図4に示す手順で生成されるメッセージ管理クラス600と、ソースファイル610と、後述する手順で作成されるドキュメント620との記述に関する構成例を示す図である。図4の処理を開始すると、メッセージ管理クラスの外枠を自動で作成(ステップS401)した後、メッセージ資源定義ファイル203(図2,3)の内容からメッセージ管理クラス600を作成する(ステップ402〜ステップ404)。   FIG. 4 is a flowchart showing a procedure for automatically creating a message management class 600 described later by the message class generating device 201 shown in FIG. FIG. 6 is a diagram showing a configuration example regarding the description of the message management class 600 generated by the procedure shown in FIG. 4, the source file 610, and the document 620 created by the procedure described later. When the processing of FIG. 4 is started, the outer frame of the message management class is automatically created (step S401), and then the message management class 600 is created from the contents of the message resource definition file 203 (FIGS. 2 and 3) (steps 402 to 402). Step 404).

すなわち、ステップ402において図3の符号306で示すメソッドネーム“ioError”を図6に示すメッセージ管理クラス600の“public Message ioError…”に転記する。ステップS403において、図3の符号302の内容を図6のメッセージ管理クラス600のクラスコメント「ID001{0}の処理でI/Oエラーが発生しました。」に転記する。   That is, in step 402, the method name “ioError” indicated by reference numeral 306 in FIG. 3 is transferred to “public Message ioError...” Of the message management class 600 shown in FIG. In step S403, the content of the reference numeral 302 in FIG. 3 is transferred to the class comment “I / O error occurred in the process of ID001 {0}” of the message management class 600 in FIG.

ステップS404において、上記メソッドのパラメタ情報である要素307から、図6のメッセージ管理クラス600のパラメタ定義「java.io.File file,
Throwable cause」、およびパラメタのコメント「@param fileファイル名」「@param cause エラー内容」を作成する。
In step S404, from the element 307 which is parameter information of the above method, the parameter definition “java.io.File file,
"Through cause" and parameter comments "@param file file name" and "@param cause error contents" are created.

次いで、符号307の処理が終了したか否かを判断し、終了した場合には(Y)、ステップS405に進み、終了していない場合には(N)ステップS404を繰り返す。ステップS405において、メソッドの実装を作成し、符号310の処理が終了したか否かを判断する。終了していない場合には(N)ステップS402に戻り、終了している場合には(Y)、メッセージ管理クラス600を作成する処理を終了する。   Next, it is determined whether or not the process of reference numeral 307 has been completed. If it has been completed (Y), the process proceeds to step S405. If it has not been completed (N), step S404 is repeated. In step S405, a method implementation is created, and it is determined whether or not the processing of reference numeral 310 is completed. If not completed (N), the process returns to step S402. If completed (Y), the process for creating the message management class 600 is terminated.

尚、ステップS405において実装するメソッドの内容は、図1で説明した従来の外部メッセージ資源取得の実装方法と同様の方法でよい。メソッドの実装は自動的に行われるため、人為的なミスが生じるおそれはないからである。入力ファイルはメッセージ資源定義ファイル203のみであり定義ファイルにXMLを使用しているため、メッセージクラス生成装置201はXSLスタイルシートなどで実装することができる。   The content of the method implemented in step S405 may be the same method as the conventional external message resource acquisition method described in FIG. This is because method implementation is automatic and there is no risk of human error. Since the input file is only the message resource definition file 203 and XML is used for the definition file, the message class generation device 201 can be implemented by an XSL style sheet or the like.

図5は、メッセージドキュメント生成装置202(図2)がメッセージドキュメント620(図6)を自動作成する手順を示すフローチャート図である。処理を開始すると、ステップS501において、図3の要素301と要素302とを図6のドキュメント620の1行目のIDとメッセージに記述する。次いで、ステップS502において、図3の要素303から図6のドキュメント620の2〜3行目の埋字の説明を作成する。次いで、符号307の処理が終了したか否かを判断し、終了した場合には(Y)、ステップS503に進み、終了していない場合には(N)ステップS502に戻る。ステップS503において、要素304から要因の説明を作成し(図6のドキュメントの4行目)、ステップS504において、要素305から対処方法の説明を作成する(図6のドキュメントの5行目)。次いで、符号301の処理が終了したか否かを判断し、終了した場合には(Y)、ドキュメント作成処理を終了し、終了していない場合には(N)ステップS501に戻る。   FIG. 5 is a flowchart showing a procedure in which the message document generating apparatus 202 (FIG. 2) automatically creates the message document 620 (FIG. 6). When the process starts, in step S501, the element 301 and the element 302 in FIG. 3 are described in the ID and message in the first line of the document 620 in FIG. Next, in step S502, a description of the embedded characters in the second to third lines of the document 620 in FIG. 6 is created from the element 303 in FIG. Next, it is determined whether or not the process of reference numeral 307 has been completed. If it has been completed (Y), the process proceeds to step S503, and if it has not been completed (N), the process returns to step S502. In step S503, a description of the factor is created from the element 304 (line 4 of the document in FIG. 6), and in step S504, a description of the coping method is created from the element 305 (line 5 of the document in FIG. 6). Next, it is determined whether or not the process of reference numeral 301 has been completed. If it has been completed (Y), the document creation process is terminated, and if it has not been completed (N), the process returns to step S501.

この処理における入力ファイルはメッセージ資源定義ファイル203のみであるため、メッセージドキュメント生成装置202は同様にXSLスタイルシートなどで実装することができる。   Since the input file in this process is only the message resource definition file 203, the message document generation device 202 can be similarly implemented by an XSL style sheet or the like.

このように、図6に示すメッセージ管理クラス600と、ドキュメント620とは、図3のメッセージ資源定義ファイル203に記載されたデータに基づいて自動作成することができるので、ここでの記載ミスは生じない。   As described above, the message management class 600 and the document 620 shown in FIG. 6 can be automatically created based on the data described in the message resource definition file 203 of FIG. Absent.

メッセージ管理クラス600では、メッセージの取得を、「文字列」によるキーではなく、メッセージ毎に自動生成された「メソッド」で行う。すなわち、メソッドで取得するというだけで構文エラーになる。   In the message management class 600, a message is acquired by a “method” automatically generated for each message, not by a key by “character string”. In other words, just getting it with a method results in a syntax error.

一方、メッセージの埋字はメソッドの引数に対応させる。従来のObject型の配列では、new Object[] {file, name}と指定するべきところを、例えばnew Object[] {file}などとミスしてもエラーにはならないが、メソッドの引数の場合、xxx(file, name)をxxx(file)と誤って指定すると、コンパイルエラーになる。   On the other hand, the padding of the message corresponds to the method argument. In the conventional Object type array, it is not an error if a place where new Object [] {file, name} should be specified, for example, new Object [] {file}, is not an error. If xxx (file, name) is incorrectly specified as xxx (file), a compilation error occurs.

以上に説明したように、本実施の形態によるソフトウェアのメッセージ資源管理方法によれば、同一のメッセージ資源から、プログラムのメッセージ管理クラスとドキュメントとを自動生成するため、ドキュメントへのメッセージの追加・修正漏れ等に起因する不一致を防止することができる。また、プログラムの外部に記述されたメッセージ資源をプログラム中から呼び出す際に、メソッドで取得するようにするというだけで構文エラーになる。すなわち、メッセージや引数の指定を間違えた場合にはコンパイル時にエラーになる。従って、メッセージの不良についてプログラムを実行する前に検出できるという利点がある。   As described above, according to the software message resource management method of the present embodiment, the message management class and the document of the program are automatically generated from the same message resource, so that the message is added to or modified from the document. Inconsistency due to leakage or the like can be prevented. In addition, when a message resource described outside the program is called from within the program, a syntax error occurs simply by obtaining it with a method. In other words, if a message or argument is specified incorrectly, an error will occur during compilation. Therefore, there is an advantage that a message failure can be detected before the program is executed.

本発明は、ソフトウェアのメッセージ資源管理方法及び装置として利用可能である。   The present invention can be used as a software message resource management method and apparatus.

一般的な外部メッセージ資源の利用方法の一例を示す図である。It is a figure which shows an example of the utilization method of a general external message resource. 本発明の一実施の形態によるメッセージ資源管理装置の一構成例を示す機能ブロック図である。It is a functional block diagram which shows the example of 1 structure of the message resource management apparatus by one embodiment of this invention. 本実施の形態によるメッセージ資源定義ファイルのデータ構造の一例を示す図である。It is a figure which shows an example of the data structure of the message resource definition file by this Embodiment. メッセージクラス生成装置における処理手順の流れを示すフローチャート図である。It is a flowchart figure which shows the flow of the process sequence in a message class production | generation apparatus. メッセージドキュメント生成装置における処理手順の流れを示すフローチャート図である。It is a flowchart figure which shows the flow of the process sequence in a message document production | generation apparatus. 本実施の形態によるメッセージドキュメント生成装置により生成されるデータ構造の一例を示す図である。It is a figure which shows an example of the data structure produced | generated by the message document production | generation apparatus by this Embodiment.

符号の説明Explanation of symbols

201…メッセージクラス生成装置、202…メッセージドキュメント生成装置、203…メッセージ資源定義ファイル、204…メッセージ管理クラス、205…メッセージドキュメント。 DESCRIPTION OF SYMBOLS 201 ... Message class production | generation apparatus, 202 ... Message document production | generation apparatus, 203 ... Message resource definition file, 204 ... Message management class, 205 ... Message document.

Claims (1)

ソフトウェアのメッセージ資源の管理方法であって、
ソフトウェアのメッセージ資源に対応するプログラム用の情報とドキュメント用の情報とを、1つのファイルに記述したメッセージ資源定義ファイルを作成するステップと、
該メッセージ資源定義ファイルに基づいて、一つのメッセージに対応した一つのメソッドとして作成されるメッセージ管理クラスを作成するステップと
を有する方法。
A method for managing software message resources,
Creating a message resource definition file in which information for a program corresponding to a message resource of software and information for a document are described in one file;
Creating a message management class created as one method corresponding to one message based on the message resource definition file.
JP2005190002A 2005-06-29 2005-06-29 Method for managing message resource for software Pending JP2007011586A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2005190002A JP2007011586A (en) 2005-06-29 2005-06-29 Method for managing message resource for software

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2005190002A JP2007011586A (en) 2005-06-29 2005-06-29 Method for managing message resource for software

Publications (1)

Publication Number Publication Date
JP2007011586A true JP2007011586A (en) 2007-01-18

Family

ID=37750018

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2005190002A Pending JP2007011586A (en) 2005-06-29 2005-06-29 Method for managing message resource for software

Country Status (1)

Country Link
JP (1) JP2007011586A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010079400A (en) * 2008-09-24 2010-04-08 Hitachi Information Systems Ltd System, method and program for property file reading
US7698688B2 (en) 2008-03-28 2010-04-13 International Business Machines Corporation Method for automating an internationalization test in a multilingual web application

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7698688B2 (en) 2008-03-28 2010-04-13 International Business Machines Corporation Method for automating an internationalization test in a multilingual web application
JP2010079400A (en) * 2008-09-24 2010-04-08 Hitachi Information Systems Ltd System, method and program for property file reading

Similar Documents

Publication Publication Date Title
US10795799B2 (en) Website debugger for natural language translation and localization
US8370798B2 (en) Analytical software design system
US8060791B2 (en) Annotating GUI test automation playback and debugging
US6055369A (en) Apparatus for visual programming with screen flow
US8042091B2 (en) Automatic composition of model transformations
US20050240555A1 (en) Interactive electronic technical manual system integrated with the system under test
US20070027670A1 (en) User Interface Update System
JP4613214B2 (en) Software automatic configuration device
US8955115B2 (en) Automatic generation of security checks
JPWO2004104824A1 (en) User interface application development device and development method
JP2009176064A (en) Software refactoring support device and method
JP2007011586A (en) Method for managing message resource for software
US20090288066A1 (en) Editing apparatus and method for test driven development
US20080281850A1 (en) System and Methods for Generating Runtime Messages
JP2008293382A (en) Automatic test specification generation system
JP5119765B2 (en) Specification creation support apparatus and support method
WO2023277802A2 (en) Device and method for identifying errors in a software application
JP6097231B2 (en) Program generating apparatus and method
JP5539921B2 (en) Program development tools
JPH11224211A (en) Software inspection support device
Fraser Integrating VDM-SL into the continuous delivery pipelines of cloud-based software
US11733847B2 (en) Knowledge engine auto-generation of guided flow experience
JP2006243996A (en) Job network management system
JP2021174084A (en) Test automatizing device
JP2004213488A (en) Data consistency checking device and data consistency checking method