Spring DIコンテナ

springframework AOPについて

AOP(Aspect Oriented Programming) 「アスペクト指向プログラミング」:各クラスで共通する処理を抜き出して、まとめて管理する。 ん、どんな事? 【例】 public void doHogehogeTypeA() { System.out.println("doHogehogeTypeA:開始"); (中略) System.ou…

Spring @Scope 落とし穴

@Scope("xxxxxxx") スコープに設定可能な値 スコープ値 概要 singleton Spring起動時にインスタンスを1つだけ生成。 以降は、生成されたインタンスを共有して使う。 スコープの値を設定しなかった場合は、singletonが デフォルト設定となるために気をつける…

Bean

Springを起動するとコンポーネントスキャンが走り、DIコンテナが管理するアノテーションが付けられたクラスを探す。 対象のアノテーションが以下 @Component @Controller @Service @Repository @Configuration @ControllAdvice @ManagedBean @Named @RestCon…