cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Hunsberger <peter.hunsber...@gmail.com>
Subject Re: [RT] Simplifying component handling
Date Tue, 03 Jan 2006 15:06:17 GMT
On 1/3/06, Giacomo Pati <giacomo@apache.org> wrote:
>
> I'm with Sylvain's and Gianugo's oppinion. I also see users getting
> confused with multiple choices of "how to write a component". I'd say in
> this area we need a revolution instead of an evolution.

I really don't get this objection; if I see a class that allows
constructor injection OR can be initialized via some other sequence
I'm going to think "gee, that's nice, I can do everything in one shot
instead of having to call the service manager" (or whatever) .  All
that's required to make sure that's clear is about 2 lines of Javadoc
on the constructor and if that's missing and someone does try to
initialize the class both ways you can probably make sure it either
blows up or handles things gracefully.

We use constructor injection in some of our code.  It's clean, it's
simple, it's easy to write.  Sometimes we support multiple methods of
initializing the code. It's pretty darn clear what's going on to any
user of the code. As a Cocoon user I really think that any objection
to this proposal based on "it might be confusing to users" is bogus...

--
Peter Hunsberger

Mime
View raw message