> 4) Suspend / Resume. It seems to me that any object that supports
> suspend() should support resume() as well. This is not reflected
> in the interfaces. Is there a reason for this?
Have thought about this in terms of both Suspendable/Resumable and
Startable/Stoppable. My impression is that the notions of starting and
stopping should occur under a single interface - i.e. a pair - one should
not be allow a component to start if it does not implement the contract to
stop, and the interface Disposable should extend Stoppable. Equally, one
should not suspend an object that cannot resume.
E.g.
interface Startable
{
void start()
throws Exception;
void stop()
throws Exception;
}
interface Disposable : Startable
{
}
interface Resumable : Startable
{
void suspend();
void resume();
}
Without the above, we have to document that something else (a manager) is
responsible for ensuring that a component implements interface pairs - i.e.
if a component declares that it is Startable, a manager has to ensure that
the component is stoppable - if not stoppable then the manager should not
start it. The same applies for Suspendable - if a component declares it is
Suspendable, the manager should not suspend it unless it also declares that
it is Resumable.
Cheers, Steve.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]