Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [e4-dev] How should clients be expected to dispose of IEclipseContext instances?

On Tue, Oct 20, 2009 at 9:02 AM, Axel Rauschmayer <axel@xxxxxxxxxxx> wrote:
> Commenting out of complete ignorance regarding the actual problem, but: I've
> never liked this kind of pattern, because it is hard to discover and easy to
> forget.
>
> Is there a better way of handling life cycle stages? I would expect this
> kind of method to be always there, possibly with empty implementations.

The issue here is exposure.  Users of IEclipseContext (implementing a
part, view, or editor, for example) should not see a dispose() method
and should never call a dispose() method (I believe that's the
rational).  Someone creating a new renderer is enhancing/extending the
framework and has to do a little extra work (which should probably be
documented in EclipseContextFactory), and a part implementer is using
the framework and shouldn't see this.

One possible other option would  be to put the API tooling marker:
@noreference This method is not intended to be referenced by clients

But in the past this has only been useful for closing bugs with "don't
do that" or "we told you so" ... a lot of developers miss it in the
javadoc (it's at the bottom) and haven't activated API tooling
(relatively new).

I'm still ambivalent about either way, though.

PW

-- 
Paul Webster
Hi floor.  Make me a sammich! - GIR


Back to the top