Peter Donald wrote:
>On Tue, 12 Feb 2002 14:47, Ryan Shaw wrote:
>
>>I have a question about the disposal of unreleased components
>>at system shutdown.
>>
>..snip...
>
>>In the example above, this would force users
>>to release MyComponent at system shutdown before disposing of
>>the ExcaliburComponentManager to avoid warnings.
>>
>>What do you think?
>>
>
>It is a problem and the way I would solve it was being able to specify
>dependencies between services. So service 1 can depend on service2 and so
>forth and then you can explicitly determine the order that it is acceptable
>to shutdown things. At least thats the way Phoenix does it ;)
>
Wouldn't it also be possible just to keep track of the number of lookups
- releases. Then when you want to dispose the ComponentManager go into
a loop. Call dispose on any components whose count is 0. Disposing them
should release other components. Repeat. If you reach a point where
you don't have any components with a count of 0, then this is an error
and a warning should be displayed before going ahead and disposing the
rest of them.
This way the ComponentManager takes care of the dependencies on its own
without requiring the developer to set up their dependencies correctly.
Leif
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>