creating arcs with IDs rather than roles

To: xlxp-dev@fsc.fujitsu.com
Subject: creating arcs with IDs rather than roles
Cc: 

[Also posted to xlxp-dev.]

After reading over the XLink spec a few times, I'm concerned that section
5.4 (Arc elements) creates complexity without providing compensating
benefits.  To some extent, I feel odd criticizing a section which I had
called for repeatedly, but I think we can do better.

The use of IDs feels like an odd intrusion of element-specific information
into a spec that described sets of information, and doesn't feel
well-integrated with the surrounding XLink infrastructure.  It's not clear
to me whether IDs are necessary, and it's even less clear to me that IDs
are the best solution.

In our earlier, often violent, discussions, it seemed that roles were to be
used by applications figuring out what connections should be made between
the nodes described by locators.  For example, we might have (very
simplified):

<xlink:extended title="mylink">
<xlink:locator title="starting point" role="origin" href="whatever"/>
<xlink:locator title="target 1" role="target" href="whatever"/>
<xlink:locator title="target 2" role="target" href="whatever"/>
<xlink:locator title="target 3" role="target" href="whatever"/>
</xlink:extended>

And the origin would point to the targets, but the targets wouldn't show a
link back to the origin.  (Or maybe they would, but somehow indicating that
it was going backward - application developers are supposed to be creative,
right?)

If I wanted to make those traversal paths explicit, I'd have to add an ID
and add a bunch of xlink:arcs...

<xlink:extended title="mylink">
<xlink:locator title="starting point" role="origin" href="whatever"
id="origin"/>
<xlink:locator title="target 1" role="target" href="whatever" id="target1"/>
<xlink:locator title="target 2" role="target" href="whatever" id="target2"/>
<xlink:locator title="target 3" role="target" href="whatever" id="target3"/>
<xlink:arc from="origin" to="target1"/>
<xlink:arc from="origin" to="target2"/>
<xlink:arc from="origin" to="target3"/>
</xlink:extended>

which seems a lot more complicated than:
<xlink:extended title="mylink">
<xlink:locator title="starting point" role="origin" href="whatever"/>
<xlink:locator title="target 1" role="target" href="whatever"/>
<xlink:locator title="target 2" role="target" href="whatever"/>
<xlink:locator title="target 3" role="target" href="whatever"/>
<xlink:arc from="origin" to="target"/>
</xlink:extended>

Especially when dealing with large groups of links, the bottom example,
based on roles rather than IDs seems a lot simpler.  It also feels to me
like a better match for the XLink approach.

I don't understand the claim in 4.2 that:
>We changed the suggested method of identifying the from and to values 
>from roles to IDs, making the from and to IDREFs. This disallows the 
>specification of a model of traversal from and to classes of ends, which 
>seems like the too high a level of abstraction (though admittedly this is 
>just a hunch). We wanted to allow arcs to specify locator IDs as their 
>from and to values because this would be giving specific instructions 
>for any two instances of locators.

I don't see why this is 'too high a level of abstraction', and find this
hunch misguided at best.  You can get 'specific instructions for any two
instances of locators' simply by looking at their roles without going to
the trouble of adding IDs and requiring specification of every
locator-to-locator link.



Simon St.Laurent
XML: A Primer / Building XML Applications
Inside XML DTDs: Scientific and Technical
Sharing Bandwidth / Cookies
http://www.simonstl.com

Received on Sunday, 1 August 1999 07:37:45 UTC