W3C home > Mailing lists > Public > www-jigsaw@w3.org > September to October 1996

Re: Clarification on the indexer

From: Anselm Baird-Smith <abaird@w3.org>
Date: Thu, 5 Sep 1996 12:58:53 +0500
Message-Id: <9609051658.AA10678@www18.w3.org>
To: Dave Makower <davemak@pencom.com>
Cc: www-jigsaw@w3.org, leon@pencom.com

Here is what the ResourceIndexer currently looks like (only in my
head, nothing implemented yet), speak up if this would be a problem to
you. 

-----
package w3c.jigsaw.indexer;

public abstract class ResourceIndexer {
    ResourceIndexer forward = null;

    abstract public Resource localCreateResource(File file
                                                 , String name
                                                 , Hashtable defs
                                                 , Object arg) ;

    public Resource createResource(File file
                                   , String name
                                   , Hashtable defs
                                   , Object arg) {
        Resource resource = localCreateResource(file, name, defs, arg);
        if ((resource == null) && (forward != null))
            return forward.createResource(file, name, defs, arg);
        return null;
    }

    public void initialize(httpd server, ResourceIndexer forward) {
        this.forward = forward;
        initialize(server);
    }

    public void initialize(httpd server);
}
-----

Note I am still unsure wether this should be an abstract class or an
interface. If it is an abstract class, then Jigsaw can provide the
basic mechanism for delegation among resource indexers. Otherwise this
would simply be an interface made of only the createResource and
initialize method. I am rather in favor of the bastract class, so that
Jigsaw comes with a consistent way of delegating resource creation
(otherwise everyone is going to implement its own way of dealing with
that, we mat end up in a mess).

To initialize the indexer there would be a new property
"w3c.jigsaw.indexers" that could take a list of resource inddexer that
would be chained together at creation time, eg:

if
w3c.jigsaw.indexer=myFancyIndexer|w3c.jigsaw.indexer.SampleResourceIndexer

would first create an instance of SampleresourceIndexer and call its

initialize(server);

method, and then create an instance of myFancyIndexer initialized
through  

initialize(server, sample_resource_indexer);

Hum, this seems quite nifty to me.

Anselm.
Received on Thursday, 5 September 1996 13:06:25 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 9 April 2012 12:13:25 GMT