<?xml version="1.0" encoding="UTF-8"?>
<essay xml:lang="en" version="5.0" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:gal="http://norman.walsh.name/rdf/gallery#" xmlns:foaf="http://xmlns.com/foaf/0.1/">
<info>
    
    
    
    
    
    
    
    
    
<title>Specialization and Extensibility</title><biblioid class="uri">http://norman.walsh.name/2006/01/27/specialization</biblioid>
<volumenum>9</volumenum>
<issuenum>12</issuenum>
<pubdate>2006-01-27T17:17:19-05:00</pubdate>
<date>$Date: 2006-01-27 20:18:02 -0500 (Fri, 27 Jan 2006) $</date>
<author>
      <personname>
<firstname>Norman</firstname>
	<surname>Walsh</surname>
</personname>
    </author>
<copyright>
      <year>2006</year>
      <holder>Norman Walsh</holder>
    </copyright>
<abstract>
<para>I don't think DITA's notion of specialization is really very
exciting and it sure doesn't make DITA more extensible than
DocBook.</para>
</abstract>
<dc:subject rdf:resource="http://norman.walsh.name/knows/taxonomy#DITA"/>
<dc:subject rdf:resource="http://norman.walsh.name/knows/taxonomy#DocBook"/>
</info>

<para xml:id="p1">As I've said, to the extent that there is a “which is better,
<link xlink:href="http://en.wikipedia.org/wiki/DocBook">DocBook</link> or
<link xlink:href="http://en.wikipedia.org/wiki/DITA">DITA</link>?”
debate, I'm trying to stay out of it. I'm not an impartial observer
and I don't relish the role of “defender of DocBook”. Nor do I find
any prospect of pleasure in “attacking DITA”. So mostly, I ignore the
issue.</para>

<para xml:id="p2">Mostly.</para>

<para xml:id="p3"><personname>
      <firstname>Edd</firstname>
      <surname>Dumbill</surname>
</personname>’s piece, <citetitle xlink:href="http://times.usefulinc.com/2006/01/23-dita">Lovely DITA,
DocBook fades?</citetitle> has been floating on a tab in my browser
all week. It's a fair and balanced essay, generally pretty
favorable towards DocBook, title notwithstanding, so I've got nothing
to complain about…except for the
part where he says</para>

<blockquote>
<para xml:id="p4">DocBook is a fixed element and attribute set, DITA is
extensible, allowing the definition of custom information types
</para>
</blockquote>

<para xml:id="p5">That's just flatly wrong. The part about DocBook, anyway.
DocBook has always been one of
<emphasis>the most</emphasis> extensible schemas around. We didn't put
thousands of parameter entities in the DTD version just so we could
watch early SGML parsers crash. Nor have we carefully and deliberately
established extensible patterns throughout the RELAX NG version solely
for our own amusement.</para>

<para xml:id="p6">What Edd is appealing to here is DITA's notion of
“specialization”. The marketing folks behind DITA products and
consultancies have latched onto specialization as if it were some sort
of silver bullet to slay the document interchange monster. A little web
searching for “DITA specialization” will turn up plenty of
hype.</para>

<para xml:id="p7">I'm not saying it isn't useful, but let's consider what it
really means. The idea behind specialization is that when I invent a
new element, I declare what existing element it “specializes”. In
theory, this declaration allows a tool processing my document to fall
back to some default processing if it doesn't understand my
specialization. The thing to remember is, the extent to which this
fall back processing is useful or correct depends largely on the
importance of the semantics of your new element.</para>

<para xml:id="p8">Let's consider a case where it works reasonably well. Suppose I
make lots of references to
<link xlink:href="http://www.wikipedia.org/">Wikipedia</link> in my writing.
Everytime I make a Wikipedia reference, I type markup like this:</para>

<programlisting>&lt;link xlink:href="http://www.wikipedia.org/wiki/Thing"&gt;Thing&lt;/link&gt;&lt;/programlisting&gt;</programlisting>

<para xml:id="p9">After a while, I get tired of this and decide that I'm going to
craft an extension to simplify my life.
Instead of writing it all out,
I create a <tag>wikipedia</tag> element that specializes<footnote>
      <para xml:id="p10">
Whether this particular specialization is possible in DITA, I don't know.
But the principle stands irrespectively.</para>
    </footnote>
<tag>link</tag>. Now I can just write:</para>

<programlisting>&lt;wikipedia&gt;Thing&lt;/wikipedia&gt;</programlisting>

<para xml:id="p11">I'll customize my system to handle the <tag>wikpedia</tag> tag,
but if I send the document to you without my customizations, your
system will fall back to <tag>link</tag> processing. That means you
won't get exactly the right output, but it'll be pretty close. You'll
get the right text, but not the link.</para>

<para xml:id="p12">On the other end of the spectrum, suppose you want to add something
with quite specific semantics.
<link xlink:href="http://en.wikipedia.org/wiki/Extended_Backus-Naur_form">EBNF</link>
diagrams, for example. Here you're going to have to have elements like
<tag>production</tag>, <tag>left-hand-side</tag>, and
<tag>non-terminal</tag>. There's unlikely to be anything in the base schema
with semantics that are even close to that, so you'll probably end up having to
specialize paragraphs and phrases. If you take a quick look at what
a typical EBNF diagram
<link xlink:href="http://docbook.org/tdg5/en/html/productionset.html#ebnf.expression">is supposed to look like</link>, you'll have no difficulty imagining
how completely unusable the fall back presentation of that markup is going
to be.</para>

<para xml:id="p13">I've
<link xlink:href="/2005/10/21/dita#specialization">already shown</link> how
the notion of specialization could easily be added to DocBook, and there 
might be some value in doing so, but it would be a foolish mistake to
believe that such a feature was going to fix all your interchange problems.
<link xlink:href="http://docbook.org/tdg5/en/html/appf.html">Interchange</link>
is a complex issue that needs to be approached thoughtfully.</para>

<para xml:id="p14">And there's nothing about it that makes DITA more extensible
than DocBook.</para>

<para xml:id="p15">It's all mostly irrelevant anyway. If experience with DocBook is
indicative, and I think it is, very few users are every going to make
<emphasis>any customizations</emphasis> to the markup <emphasis>at
all</emphasis>. Sure, some big companies will hire consultants to
craft customizations for them, but they're in the minority. Most users
just grab the schema and start using it.</para>

</essay>

