JAVA-959: Migrate spring-di to com.baeldung

This commit is contained in:
Krzysiek
2020-03-11 21:09:04 +01:00
parent c450a63dca
commit ca74f4b84e
9 changed files with 50 additions and 50 deletions

View File

@@ -0,0 +1,23 @@
package com.baeldung.store;
import org.springframework.context.annotation.Bean;
public class AppConfig {
@Bean
public Item item1() {
return new ItemImpl1();
}
@Bean
public Store storeThroughConstructorInjection() {
return new Store(item1());
}
@Bean
public Store storeThroughSetterInjection() {
Store store = new Store();
store.setItem(item1());
return store;
}
}