9.2.13. Bean Proxies
22.214.171.124. About Bean Proxies
Problems of dependency injection, which are solved by using proxies
- Performance - Proxies are much faster than dependency injection, so you can use them in beans which need good performance.
- Thread safety - Proxies forward requests to the correct bean instance, even when multiple threads access a bean at the same time. Dependency injection does not guarantee thread safety.
Types of classes that cannot be proxied
- Primitive types or array types
- Classes that are
- Classes which have a non-private default constructor