[seasar-dotnet:2191] Re: S2Container/S2Dao 1.4.0 RC3 リリース

Daisuke SAITOH [E-MAIL ADDRESS DELETED]
2012年 8月 19日 (日) 23:45:43 JST


齋藤と申します。
Seasar.NET 1.4.0 RC3 リリースを試用中させていただいてます。

本リリースの.NET2.0版にて、インターフェースを使用した際の、再帰的DIが正
常に処理されません。
RC3の一部をRC2の状態に戻したら動作しました。(再現手順の8)

以下、ちょっと長いですが再現手順です。
お手数ですがご確認いただければ幸いです。

====
■1. Visual Studio 2008 Express で .NET2.0 版をビルド。
 (ちなみに、VS2010で2008用ソリューションを取り込んだ場合も同結果)

■2. プロジェクト「Seasar.Quill.Examples-2008」を実行するため、app.config
を修正。
 a) <configSections> に
  <section name="quill" type="Seasar.Quill.Xml.QuillSectionHandler,
Seasar.Quill"/>
  を追加。
 b) ファイル Seasar.Quill.dll.config にある <quill> セクションをコ
ピー&ペーストで追加。

■3. 同プロジェクトを実行し「社員検索」ボタンクリックで "ALLEN" が表示さ
れる。
 正常動作を確認。

■4. 同プロジェクトをインターフェース利用に修正する。
 まずロジッククラス EmployeeLogic.cs を修正。
 a) 行25 の 「[Implementation]」を削除。
 b) 行26 を 「public class EmployeeLogic : IEmployeeLogic」に変更。
 (インターフェース IEmployeeLogic を追加)

■5. ロジックインターフェースとして IEmployeeLogic.cs を追加。
--
using Seasar.Quill.Attrs;
using Seasar.Quill.Examples.Entity;
namespace Seasar.Quill.Examples.Logic
{
[Implementation(typeof(EmployeeLogic))]
public interface IEmployeeLogic
{
Employee GetEmployeeByEmpNo(int empNo);
}
}
--

■6. Form1.cs のロジック用変数を、クラスからインターフェースに変更。
 a) 行28を「protected IEmployeeLogic employeeLogic;」に変更。
 (型を IEmployeeLogic に)

■7. 同プロジェクトを実行し「社員検索」ボタンクリック。すると例外発生が発生。
--
System.NullReferenceException はハンドルされませんでした。
Message="オブジェクト参照がオブジェクト インスタンスに設定されていません。"
Source="Seasar.Quill.Examples"
StackTrace:
場所 Seasar.Quill.Examples.Logic.EmployeeLogic.GetEmployeeByEmpNo(Int32
empNo) 場所 C:\Documents and Settings\xxxx\My Documents\Visual Studio
2008\Projects\s2container.net-1.4.0-RC3\source\Seasar.Quill.Examples
\Logic\EmployeeLogic.cs:行 33
--
 ※エラー箇所 行33は
「Employee emp = employeeDao.GetByEmpNo(empNo);」
 です。employeeDao が null になっている。(再帰的にDIされない)

■8. RC3で修正された QuillInjector.cs の 行349 を RC2 に戻してみる。
 「Inject(component.GetComponentObject(implType));」
 (引数の field.FieldType を implType に)

■9. 全体をビルドして「Seasar.Quill.Examples-2008」を実行。
 「社員検索」ボタンをクリック。"ALLEN"が表示される。
 (再帰的にDIされる)

====
以上、よろしくお願い致します。

--
Daisuke SAITOH (齋藤大輔)
dsaitoh @ grn.janis.or.jp


(2012/08/13 21:49), kotani.k wrote:
> 小谷(koyak)です。
>
> S2Container/S2Dao 1.4.0 RC3をリリースしました。
>
> 変更点は下記ページをご覧下さい。
> http://www.seasar.org/wiki/index.php?cmd=edit&page=SeasarWhatsNew%2F2012-08-13
>
> 主に不具合修正の反映になります。
>
> DBFlute.NET 0.8.9.45の下記exampleプロジェクトでも
> 動作確認をしています。
>
> ・dfnet-asp.net-example
> ・dfnet-basic-example
> ・dfnet-multipledb-quill-example
>
> 現在のところ.NET4.0対応は2種類のDIコンテナのうちQuillのみ行っています。
> S2Containerをお使いになる場合はver.1.3.Xのご利用を推奨致します。
> _______________________________________________
> seasar-dotnet mailing list
> seasar-dotnet @ ml.seasar.org
> https://ml.seasar.org/mailman/listinfo/seasar-dotnet
>




seasar-dotnet メーリングリストの案内