Re: Request for ClassPath API extension.
Tomas Zezula <[email protected]> Wed, 25 Jun 2003 11:37:43 +0200
| Newsgroups | gmane.comp.java.netbeans.modules.projects.devel |
|---|---|
| Message-ID | <[email protected]> |
Svatopluk Dedic wrote: > Tomas Zezula wrote: > >> After obtaining new usecases and requirements for ClassPath API, I >> have decided to >> extend the functionality of the PathResource class by adding the >> getHandle () operation into it. >> The operation should return null for transient PathResources or >> PathRsource.Handle >> for persistent ones. >> > Q: what will be the Handle contract ? Do you suppose some PathResource > get() operation on the handle ? > For the client to just identify a PathResource coming into its face > from a Classpath, it is sufficient (but maybe not efficient) to do > stored_deserialized_handle.equals(acquiredResource.getHandle()). > > If there is PathResource get(), then the client is actually able to > reach that PatResource instance, which may be a little tough :) to > implement. The reason of handle is not only to identify the Resource by CP client but it should be also used during serialization in Java Project module. The ClassPath should persist only the handlers to resources (by reference) instead of resources (by value). I agree with you, that the implementation of this can be hard. The getResource operation should return the same resource for all clients calls in the the Resource from the handler should be singleton. Tomas. > > > -Svata > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] >