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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
