From: Gerd M. <ge...@sm...> - 2001-06-26 07:19:34
|
On Mon, 25 Jun 2001 12:17:15 -0700 Jack Park <jac...@th...> wrote: > But, what about an occurrence that happens to be stored in your local > persistent store? How do you reference it? Particularly, how do you > reference it such that others could, at a minimum, write and ask you for a > copy--given that you might have published the topic map on the web or sent > it off for merging elsewhere. > > Right now, I am using typed occurrences and I am willing to make my > persistentXTM implementation smart enough to check type before accessing an > occurrence. Kal's interface suggestion looks interesting. Can it be > viewed as a general enough solution that we could then generate PSI's for a > variety of occurrence types, turning an XTM engine into a kind of grove engine? We would need some lookup service that tells us which topicmaps are around there and what topics they 'export' for external use. The export set of topics could be managed via a scope, i.e. all topics in a special export-scope are available for external use. And we would need a protocol for topicmap engine communication, e.g. Soap. Having said this, I would suggest the following interfaces: public interface TopicMapProviderFactory { public TopicMapProvider createTopicMap( Properties ); } public interface TopicMapProvider { public TopicMap getTopicMap(); public String getURL(); } These two interface are necessary to intergrate a topicmap into a system. With getTopicMap() I get the map handled by this provider. I'm not sure if we need getURL() since TopicMap already has a getBaseURL() method. public interface TopicMapManager { public void initialise(Properties) throws TopicMapManagerException(); public TopicMap getTopicMap(String sourceURL); public Collection getTopicMaps(); public registerProvider( String providerFactoryClassName, Properties ); } The TopicMapManager manages all TopicMapProviders known by a system. The registerProvider() method adds a provider to the manager by using the given factory class. > > > I think that the solution to this problem lies in something that Gerd and I > > > discussed briefly a little while ago and that is creating a more > > generic way > > > to create and access TopicMap objects. We already have the TopicMapFactory > > > interface, which at least provides a generic means of creating topic map > > > objects regardless of the back-end. However, I think that what we also need > > > is a TopicMapManager interface which would enable a back-end to provide a > > > generic interface for accessing and creating TopicMap objects. > > > > > > I am thinking of an interface something like this: > > > > > > import com.techquila.topicmap.*; > > > import java.util.*; > > > > > > public interface TopicMapManager { > > > > > > public TopicMapManger(); > > > public void initialise(Properties) throws TopicMapManagerException(); > > > public TopicMap getTopicMap(String sourceURL); > > > public Collection getTopicMaps(); > > > > > > } > > > > > > The init() function takes a java property set, which would enable any > > > back-end specific initialisation to be passed en-masse (and so manage > > things > > > like establishing a database connection and setting up internal caches). > > > Perhaps an additional function to set properties one-by-one might also be > > > useful. > > > > > > The getTopicMap() function returns a topic map whose sourceURL property > > > matches that specified in the parameter. > > > The getTopicMaps() function returns all of the TopicMap objects that the > > > manager knows about. > > > > > > Jack, you should then be able to get the referenced topic map by checking > > > with the TopicMapManager (equates to the XTMSession object I guess). > > > Although your topic map will still need to use the full URL for referencing > > > the topic map as an occurrence (or else your code needs to have some smarts > > > to recognise how to process the occurrence according to its type). What about that ? Best Regards, Gerd -- ________________________________________________________________ Gerd Mueller ge...@sm... SMB GmbH http://www.smb-tec.com |