> From: Niclas Hedhman [mailto:[EMAIL PROTECTED] 
>
> Back to the bottom-line; What about 
> ServiceManager.release()?? Should it be 
> deprecated? 
> IMHO, 
> 1. Deprecated, or
> 2. Enforced, or "soft enforced" (i.e. reported as a problem).
> 
> I don't really care which one, but having a weak contract is not good.

(I have seen this bottom line before.)

Niclas,

basically, we've been here before. The sequence is usually that someone
introduces the concept of no release. Then someone else pops up with
a use case that *requires* a release. Then we get a marker interface
or extension like ReleaseRequirement. Then someone remarks that you
have to test for this *all the time*. Then someone comes up with
something
like ReleaseUtils.maybeRelease (Object component), that will do the test
for you and release if needed. Then someone adds 1 and 1 and figures
that
since ReleaseUtils.maybeRelease must be called *all the time*, we might
as well use release() as we did in step 1.

The only way out is to do a huge backwards-incompatible change: No
relase() 
at all. All components are singletons. If you want something else, you
have 
to code it yourself. For example, instead of looking up SAXTransformers,
you do one lookup for a SAXTransformerFactory in the service() method,
and
then you use that factory.

/LS


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to