Why this page? To be honest I created it to preserve interesting code snippets for later use among other things. I hope you will also find it useful.
The DI containers I will use:
- Spring - older but still very popular, mostly because with Spring the developers gets a framework that addresses almost any area in software development. XML for configuration is dead - so we will use Java based configuration solely.
- Guice - super elegant and concise DI, but don't expect much more
- CDI - standard in JavaEE 6, differs from Spring mostly when it comes to handling scopes
- (one for Scala world later)
The main focus in samples is on (might change):
- Injection (type-safety, support for generics)
- Factories
- Parameters / Partial injections
- Constants
- Scopes
- Interceptors
- Events
Real World Use cases:
- Transactional service
- Type-safe configuration
- Caching
- Remoting
Source code for running samples can be found at Github:
https://github.com/durdina/samples/tree/master/di-1
https://github.com/durdina/samples/tree/master/di-1
0 comments :
Post a Comment