james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Heath <m...@cycletime.com>
Subject RE: SpringJames vs. JamesNG
Date Sat, 02 Apr 2005 00:07:45 GMT
On Thu, 2005-03-31 at 16:10 +0100, Daniel Perry wrote:
> I've used both setter and constructor dependency injection.  I much prefer
> the constructor approach:
> -All dependencies are in one place - the constructor - this causes bloat,
> but makes maintenence easier as it's only one method.
> -Consequestly all dependencies are supplied in one go, and as the whole
> constructor must be filled, all dependencies must be filled, where as SDI
> relies on all methods being called. This makes no real difference when a
> container is creating the class, but it makes it easier to use a component
> from code - you can immediatly see what you must provide.

One advantage to setter dependency injection is that it allows you to
AOP.  If there is no default constructor, you can't do AOP, at least,
with AOP frameworks I've used.

Just my $0.02.

-Mike


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message