+/- 0 if you intend to keep the interface in ecalibur. If not then it is 
probably best to usemore neutral names. Maybe something like

interface Constructed extends Initializable, Disposable {}
interface Active extends Manager, Suspendable {}

On Thu, 7 Feb 2002 03:17, Berin Loritsch wrote:
> I am throwing this out there for general consumption.  I have been
> thinking, Managers inherently manage resources.  That means that the
> resources must be initialized and disposed of properly.  Instead of forcing
> the class using the interface to perform dynamic ***Manager instanceof
> Initializable calls, I propose to have a systemic approach that all
> Managers are Initializable and Disposable.
>
> The proposed interfaces would be:
>
> interface Manager extends Initializable, Disposable {}
>
> interface ActiveManager extends Manager, Suspendable {}
>
> This provides a nice and simple interface without the user of the manager
> having to check for dynamic things.  I don't want the Startable interface
> because it merely confuses things.  It is either initialized or not.  This
> would allow me to provide functionality like this:
>
> ContainerManager manager = new ContainerManager( initialParams );
> manager.initialize();
>
> // do stuff
>
> manager.dispose();
> return;
>
> If I decided to specialize ContainerManager to manage an active Container,
> I would have something like this:
>
> ActiveContainerManager manager = new ActiveContainerManager( initialParams
> ); manager.initialize();
>
> // do stuff
>
> manager.suspend();
>
> // wait for a while
>
> manager.resume();
>
> // do more stuff
>
> manager.dispose();
> return;
>
>
> As you can see the approach allows me to interact with the ContainerManager
> (the root Manager in my system) in a consistent manner without having
> unnecessary casts).
>
> Furthermore, certain managers like the CommandManager require the
> Suspendable interface for those times when you really want to suspend a
> system.  It provides a nice and tidy method for doing things.
>
> The concept behind the Manager is that it should be easy to use--without
> too many lifecycle methods.  Initialize and Dispose are very common in the
> world of managed resources.
>
> I am open to feedback on this issue.

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

Reply via email to