[Jslib] Re: RDF classes

Martin Kutschker dreckskerl@glump.at
Mon, 11 Feb 2002 18:20:59 +0100


Eric Plaster wrote:

> 
> I've been puttsing with the code for a while now, so I thought I better 
> just put it out there.  I finally finished up the documentation and put 
> a link in the nav_bar.  I would appriciate it if people would go through 
> the documentation and the code and do a peer review on it.  Any 
> criticism is welcome.


Great!

Ok, let's start with the nitpicking - just reading the docs :-)

The addXXX()-methods use a relative name scheme. You cannot add a 
resource with an arbitrary name. Perhaps some addXXXAbsolute().methods 
could be used to solve this problem.

The RDF class only allows for "root" containers. Why? It is perfectly ok 
to have a node as root element. I suggest ading addRootNode(). I'm not 
sure if we need a getRootNode.

The container class is missing a getResource method. It would be nice 
have access to the underlying XPCOM component. [Note: RDFResource and 
RDFContainer might derive from a RDFBaseResource class to add this 
functionality.]

The container classes lack the insertAt and removeFrom calls the XPCOM 
interface provides.

Reference attributes are still missing. I have posted, based on another 
post, a method for the old version of the rdf classes.

Eg, in chrome.rdf i found something like this:

<RDF:Seq about="urn:mozilla:locale:root">
     <RDF:li resource="urn:mozilla:locale:en-US"/>
     <RDF:li resource="urn:mozilla:locale:US"/>
</RDF:Seq>

How would I do this with the classes?

Anyway, I'm pleased you found some time to actually publish your work. 
Thanx.

I might feel for adding some of these thing, if I create a new version 
of mozCalc.

Masi