avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Donald <pe...@apache.org>
Subject Re: lifecycle management
Date Wed, 02 Jan 2002 09:07:05 GMT
On Wed, 2 Jan 2002 07:43, vinay nair wrote:
> Hi,
> Have been reading the excellent artifact written by
> Berin Loritsch on "Developing with Avalon" .
>
> A query derived from there.
> (from page 32).
> Why does an individual component have to be made to
> write code so as  to honor a policy of lifecycle
> management; which is that methods calls like
> configure(),compose() ...etc has to be called ONCE and
> only ONCE during components lifetime and we have to
> write code to keep track of that with boolean flags
> indicating whether the method was called or not.
>
> I mean why doesn't the LifeCycleHelper class itself
> keep track about the number of times the component's
> lifecycle methods .
> This would also remove that small mess of boolean
> flags created in each component to keep track of this
> behavior.
> (private boolean initialized = false;private boolean
> disposed = false; etc....
> )
>
> Is this way of tracking of *valid* calls made to the
> components outside the component , a poor design.?

I think so ;) However others disagree. Personally if I see any code like that 
in lifecycle interfaces I go through and remove it. Others like it so do what 
you are more comfortable with. 

BTW There was a thread about this not long ago on this list (I think it had 
"ComponentValidator" in the title) if you want to see some of the discussions.

-- 
Cheers,

Pete

"You know what a dumbshit the 'average man' on the street is? Well, by
definition, half of them are even dumber than that!"
					J.R. "Bob" Dobbs

--
To unsubscribe, e-mail:   <mailto:avalon-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-dev-help@jakarta.apache.org>


Mime
View raw message