Dependency injection discourages object-oriented programming? @ Blog of Adam Warski - 0 views
www.warski.org/...es-object-oriented-programming
java javaee6 CDI CdiDependencyInjection OO Object-Oriented procedural DI DependencyInjection

-
Dependency injection discourages object-oriented programming?
-
if you’re using DI, and you have an X entity, do you have an XService or XManager with lots of method where X is the first argument?
-
previous way is more procedural
- ...12 more annotations...
-
service/manager is a set of procedures you can run, where the execution takes a product and a customer as arguments
-
encourages the ProductService approach
-
well, dependency injection, but moreover, the soa approach to service design tends to force otherwise intelligent software engineers into doing procedural design the services just end up being bags of method calls that implement any type of behavior, with the domain objects or entity beans being reduced to mere data structures with little responsibility or behavior beyond persistence. (which, in this anti-pattern, is typically mostly provided by the repository or dao class! ie. domain object crud)
-
-
it’s just easier
-
many benefits
-
it’s not for small projects
-
problems with DI frameworks: