AstroGrid registry structure

Ray Plante rplante at poplar.ncsa.uiuc.edu
Fri Jun 20 01:31:19 PDT 2003


Hi Tony,

(Again, I'll limit my comments to a few items.)

This looks better.  In particular, some of the structures that embodied 
"is-a" relationships have disappeared.  

As I mentioned, I prefer using XML containment to capture "has-a"  
relationships; however, your schema still uses containment for an
important "is-a":  that is, you have "Resource/Service" and
"Resource/Organization", suggesting that a Resource "has-a" Service.  
In my view, a service "is-a" resource.

In VOResource, I capture "is-a" with a combination of type extension and 
substitutionGroups.  In particular, a "Resource" element is of type 
"genericResource".  The "Service" element's type extends "genericResource" 
to add additional metadata.  In addition, "Service" is declared to be in 
the substitutionGroup="Resource", meaning it can be used anywhere that 
"Resource" is used.  (See diagrams to see how XMLSpy renders this 
relationship.)  

A substitutionGroup functions almost identically to a choice; that is, 
it's like having a choice with "Resource", "Service", and all the other 
members of the group (DataCollection, Organization, etc.) in it.  I prefer 
substituionGroups, however, over choices because it makes extensions 
easier.  For example, suppose later we wish to add a new type of resource, 
say a "Table" or "Standard".  This would require that we update 
tlRegistry.xsd to include it in the choice structure (even if its contents 
are defined in a separate file).  With a substitutionGroup, the new 
resource can say independently, "I am a Resource"; this means that the new 
element and all its contents can be defined in a separate schema file 
without having to change tlRegistry.xsd.  

This safeguards you from backward-compatability issues and makes the
testing and standardization process easier.  Furthermore, it relieves you
from having to define everything up front.

When you use this type of "is-a" with Resources, it gives your XML a nice 
look:  the top element of each resource displays what type of resource it 
is...
  <Organization>
    ...
  </Organization>
  <Service>
    ...
  </Service>
...and the use of types extensions gives you polymorphism that translates 
well to software.  

cheers,
Ray




More information about the registry mailing list