This pattern has been used for a while, and the requirement to release the
resource is documented (e.g. try ... finally is considered part of the API usage
pattern).
These objects facade the edit models, which each have a client access
registry. This object will track requestors in a smart way, and unreleased
models will throw exceptions that indicate exactly where from a model was
incorrectly accessed (and later not disposed).
We have moved away from this pattern with our Virtual Path API which will
be using the StructureEdit (formerly ModuleCore) EMF layer. Clients will now be
using a handle based model backed by the EMF model for accessing the information
in the .wtpmodules file.
Clients will still be required to follow this pattern for the ArtifactEdit
classes.
-------------------------------------------------------------------------
Kind Regards,
Michael D. Elder
Rational Studio / J2EE Tools
Development
IBM RTP Lab
Ext: (919) 543-8356
T/L: 441-8356
mdelder@xxxxxxxxxx
Wednesday, April 06, 2005 11:41 PM
To: wtp-dev@xxxxxxxxxxx
cc:
From: David M Williams/Raleigh/IBM@IBMUS
Subject: [wtp-dev] Proposed new
pattern for managed models (was "Re:
Scary code")