I was watching a presentation by Uncle Bob. In the end of that presentation (last 10 min), He argued that we should abstract everything (Even frameworks) from our business logic.
JAVA EE does a great job in doing so. UI is abstracted by JSF (and other technologies). The database is abstracted by the persistence layer (JPA), even IOC container (Framework) can be abstracted by using standard annotations (CDI).
So far so good, but some frameworks completely ignore CDI and introduce their own Annotations (Bad sign! they are trying to couple their framework to our code). How we can prevent it. Uncle Bob's advice is to limit the use of Dependency Injection in our code and use other patterns such as Factory method, ...
But I think it is not a feasible approach for example for Dependency Injection we need to implement Service locator pattern (re inventing the Well) we can't have the functionality that frameworks provide (life cycle callbacks, ...).
Any thoughts ??