2011-02-16から1日間の記事一覧
3.14 The BeanFactory 基本的にBeanFactoryを直接使う必要はなくApplicationContextを使えばOK。以上。3.14.2 Glue code and the evil singleton 根性切れた。省略
概要 ApplicationContextは、BeanFactoryの機能に以下が追加されている MessageSource (リソースバンドル) ResourceLoader (URLやファイルリソース) ApplicationListener (イベント配信) HierarchicalBeanFactory (コンテナ間の連携?) 3.13.1 Inter…
<beans> <context:load-time-weaver/> </beans> これを付けるとLoadTimeWeaverAwareをインジェクションできる。これはJPAなどロード時のウィービングを行う場合に役立つ。詳細は別で。
3.11.1 Basic concepts: @Configuration and @Bean @Configurationをつけたクラスに、@Beanをつけたメソッドを定義するとbeanを定義できる。というのが中心概念。メソッド名がbean名になります。 3.11.2 Instantiating the Spring container using Annotatio…
3.10.1 @Component and further stereotype annotations ステレオタイプアノテーションについて。 @Component Springが管理するコンポーネントを表す。 @Controller MVCのコントローラ @Service サービス層 @Repository DBアクセス クラスアノテーションとし…
概要 大まかにサポートするアノテーションは以下のとおり @Required @Autowired JSR-250(@Resources,@PostConstruct) JSR-330(@Inject,@Qualifier,@Named,@Provider) → CDIですね。 これらのアノテーションを使うためには、対応するBeanPostProcessorが登録…