Noel J. Bergman wrote:
Serge Knystautas wrote:
Noel J. Bergman wrote:
Alexander Zhukov wrote:
By mentioning JNDI I guess you are talking about ServiceLocator pattern, right? It is considered as anti-pattern.
Not here:
<snip /> What is your point Noel?
That there is a usefulness, and that the supposed positioning of the pattern as an anti-pattern isn't even agreed by those held up as the champions of CdI. I think both approaches have their place.
Pragmatically, unless we are to rewrite the universe and exclusively use services offered up as CDI oriented POJOs, we are going to run into this over and over - JNDI, JDBC, JavaMail, and so forth.
The approach I take is to wrap such services within a lighweight CDI style adaptor > so that the "smell of an anti-pattern" is contained within a single
component.
This enables all components to be plugged together using CDI, avoiding confusion
and the "whiff" of different metaphors ("different metaphors" is non-religous speak for anti-pattern) spreading throughout the architecture.
A huge +1
Sure we cant refuse JNDI completely (jamesng proposal uses it as an example LDAP store, which is by the way called JNDIUserStore:))
But putting JNDI Context inside each and every class that needs configuration definitely ties all of our efforts back to avalon-style solutions.
Apart from that we cant expect to write everything ourselves which means we should exetensively use modules from other projects. And other projects are out of our control, but still need configuration.
Wrapping these modules with CDI style adators instead of inventing yet another wheel would be a huge benefit.
Another point to give up any configuration (in a component gluing) style except CDI is its unbelievable simplicity. What is simple is guaranteed to work more reliably than that comlex.
-- Steve
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]