avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Berin Loritsch <blorit...@apache.org>
Subject Re: [Framework] Dualities in Activity methods
Date Mon, 23 Apr 2001 13:01:18 GMT
Peter Donald wrote:
> Hi,
> Taking this one step further we would see that Initialize/Dispose are a
> dual aswell and by the same token should be kept together. There could be
> also an arguement that start/stop *should* extend initialize/dispose.

They are a natural pair.  However this does not mean they are codependant.
When two interfaces are bound to each other it usually means using them
separately can lead to dangerous coding practices or even difficult to
track bugs.

The idea of Initializable interface is that by contract the Component has
received all of its Configuration, Context, ComponentManager, etc. abjects.
At this point, it is safe for the Component to create new Components and
pass any of the lifecycle Component objects.  Not every Component needs this
complexity, and right after Configuration it is ready to go.

Conversely, the Disposable interface is by contract the last part of the
lifecycle before the Component is readied for the garbage collector.  It
is important to note that Disposable isn't just for propogating the
dispose() message to all child Components, but that it can be used for
general cleanup.  Hense, there are many uses where Initializable isn't
needed, but Disposable is.

I beleive that by keeping these two interfaces separate and distinct (although
a natural pair) is more beneficial than harmful.

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

View raw message