Spring

Inversion of Control (IoC) 原則の実装である依存オブジェクト注入について以下整理する。

動作確認のための準備

SpringのIoCコンテナのベースは、org.springframework.beansorg.springframework.contextパッケージから構成されている。動作確認しながら仕組みを理解するために、Eclipse等のIDEでMavenプロジェクトを作成し、以下の設定をpon.xmlに追加しておくと良い。

<dependencies>
	<!-- https://mvnrepository.com/artifact/org.springframework/spring-core -->
	<dependency>
		<groupId>org.springframework</groupId>
		<artifactId>spring-core</artifactId>
		<version>5.0.7.RELEASE</version>
	</dependency>
	<!-- https://mvnrepository.com/artifact/org.springframework/spring-context -->
	<dependency>
		<groupId>org.springframework</groupId>
		<artifactId>spring-context</artifactId>
		<version>5.0.7.RELEASE</version>
	</dependency>
</dependencies>

参考 https://mvnrepository.com/artifact/org.springframework

Dependency Injection


トップ   一覧 単語検索 最終更新   ヘルプ   最終更新のRSS
目次
ダブルクリックで閉じるTOP | 閉じる
GO TO TOP