クラス間の依存関係の重要なツリーがあるとしましょう。サイクルはありませんが、いくつかのレベルの深さがあります。一番下に hibernate がありますSession。
MyService -> MyDao -> Session
MyService -> MyCollaborator -> AnotherCollaborator
MyCollaborator -> MyDao
AnotherCollaborator -> MyDao
AnotherCollaborator -> AnotherDao -> Session
あなたは要点を理解します。
SessionGuice の外部で手動で作成し、Guice を使用しMyServiceて、 this を使用して下からグラフ全体を生成したいと思いますSession。どうすればできますか?