>
>
> I agree with the skepticism about AOP but strongly disagree about DI.
>

Mind you, I do not "strongly disagree with DI", Guice is indeed very nice 
(but also not your typical heavyweight Spring framework full of XML). 
However, I strongly disagree with the premise that we should drag in and 
rely on omnipotent wiring containers just for the sake of them. It still 
baffles me for instance, that so few people know and use SPI's 
(ServiceLocator pattern), when that's a neat built-in mechanism for 
dependency injection through the class-path. While singletons have been 
declared an anti-pattern and can probably cost you a job interview just for 
mentioning it, this is often because people have not paired it with a 
ServiceLocator. That's a perfectly viable and simple solution to the dependency 
carrying problem (access to some common shared application context, say 
connection pool, further down the dependency chain). Need a special mock 
version of a component? Implement the SPI and declare a dependency in the 
test scope/classification of your POM .

>

-- 
You received this message because you are subscribed to the Google Groups "The 
Java Posse" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/javaposse/-/S80WwL6P9l0J.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/javaposse?hl=en.

Reply via email to