2.6.1 作成時の注意事項
Javaオブジェクト作成時の注意事項を次に示します。
-
CSCIWが提供するインタフェースを必ず実装してください。
CSCIWが提供するインタフェースの詳細については,「9. Javaオブジェクト呼び出し用のインタフェース」を参照してください。
-
CSCIWが提供するインタフェースを実装したクラスでは,引数のあるコンストラクタやpublic以外のコンストラクタを実装しないでください。
-
Javaオブジェクトでは,CSCIWが提供するAPIを発行しないでください。
-
データベースへアクセスする場合は,CSCIWがJavaオブジェクトに渡すjava.sql.Connectionを利用してください。
-
Javaオブジェクトの処理で,CSCIWが渡すjava.sql.Connectionのコネクションを切断したり,トランザクションを終了したりしないでください。
-
Javaオブジェクト呼び出しでは,複数スレッドから同時に実行される場合があるため,クラス変数(スタティック変数)を使用しないでください。
-
Javaオブジェクトのパッケージは,「jp.co.Hitachi.soft.csciw」以外にしてください。
-
Javaオブジェクトはリクエスト(作業アプリケーションやルール評価のタイミング)ごとにインスタンス化されます。そのため,インスタンス変数(メンバ変数)とメソッドローカル変数だけを利用したコーディングを推奨します。