-
SOLID: S Single Responsibility: Tính đơn nhiệm
-
Dependency Injection vs Dependency Inversion Khác nhau
-
Các loại di
- Property
- Setter
- Construtor(Best). Nhớ field được @Autowired thì đánh là private final
-
Có thể DI với private property được không?
- Có, vì nó sử dụng reflection để inject(Ko chỉ DI và get value từ file nó cũng làm được). Tuy nhiên đây là cách ko nên làm (Bad Practice)
-
Best practice là sử dụng DI với 1 concrete class?
- Không, sử dụng interface là tốt nhất, nó giúp linh động hơn trong việc chọn Implement
-
Annotation nào được sử dụng để chỉ ra mình muốn 1 dependency được injected @Autowired
-
If you have two beans of the same type, how do you specify a preference for one over the other? @Primary. Bean được đánh annotation này sẽ được chọn là Implement mặc định nếu ko được chỉ rõ ra bằng @Qualifier
-
2 callback intefaces nào được sử dụng để có thể hook into bean lifecycle(Tức là phạm vi chỉ bean nào implement thôi) InitilizingBean and DisposableBean(destroy)
-
2 Anotation nào có thể được sử dụng để access Spring Bean lifecycle(phạm vi Bean) @PostConstruct, @PreDestroy
-
Chỉ ra bean name mà mình muốn được injected @Qualifier
-
Notifications
You must be signed in to change notification settings - Fork 0
tienph91/spring-pet-clinic
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
Spring framework
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published