How To Deal With Interfaces In Java EE 6 (or no more Impl) : Adam Bien's Weblog - 0 views
-
How To Deal With Interfaces In Java EE 6 (or no more Impl)
-
In Java EE 6 interfaces became absolutely optional. Neither in EJB 3.1, nor CDI / JSR-330 you need interfaces. You can inject classes directly. They will be still proxied, so all aspects like persistence, transactions, interceptors, decorators are still available. So you are no more forced to implement interfaces by the container
-
used for: Strategy Pattern: there are already several implementations of an algorithm or concept Layering: there is a clear need to hide e.g. an ugly implementation of a legacy framework API (not very common): you have to expose a API, which gets implemented by SPI (e.g. JDBC)
- ...4 more annotations...