CAS Client Dependency Injection
Scott Battaglia
scott.battaglia at gmail.com
Tue Nov 21 09:39:56 EST 2006
Mark,
The point of the new JA-SIG client is to create a client that has no
dependency on an IoC container yet can work within one. You'll notice that
none of the code (except one Servlet) has any Spring dependency in it. We
could easily swap any other container or write custom wrappers around the
code. This requirement of no Spring dependency lead us down the path of
instantiating classes via argument constructors as its the only way to
guarantee that an object is completely instantiated (we can't rely on
InitializingBean or custom init methods that may not be called if we're not
using Spring). We've attempted to keep the classes flexible enough though
that they can be extended or wrapped to support other methods of
instantiation that people may decide to write.
-Scott
On 11/20/06, Mark McLaren <mark.mclaren at gmail.com> wrote:
>
> I was looking at the JA-SIG CAS Java client 3.0.0 code and was pleased
> to see that it is using the Spring Framework. I hope this is taken as
> a constructive criticism but I was a little surprised to see the
> various filters defined using constructor rather than setter based
> dependency injection. I was under the impression that generally the
> preferred approach was usually setter injection? As I understand it
> setter injection is a bit more readable for the user and does not rely
> on the order of the constructor arguments.
>
> Would it be preferable to support both methods of initialization?
>
> Mark
> _______________________________________________
> Yale CAS mailing list
> cas at tp.its.yale.edu
> http://tp.its.yale.edu/mailman/listinfo/cas
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://tp.its.yale.edu/pipermail/cas/attachments/20061121/6f0efecd/attachment.html
More information about the cas
mailing list