[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Musing over Namespaces

  • From: Ray Whitmer <ray@x...>
  • To: rev-bob@g...
  • Date: Fri, 17 Dec 1999 05:59:14 -0700

Re: Musing over Namespaces
rev-bob@g... wrote:

> Just to take a stab in the dark here, but wouldn't this fundamental difference be that Perl
> and Java are almost unilaterally self-contained parcels (hence, it doesn't matter what the
> package is named, because you're writing everything that deals with it anyway), but
> XML documents are designed for interchange - where the names don't just have to make
> sense to you, but also to an unknown client?

This is not true.  We combine Java and Perl from a variety of sources and refer to these
classes from other packages from other sources -- significantly more diverse than our current
XML declarations in terms of one set of classes referring to another.

> In other words, my only concern when naming a function or a class in a program is that I
> need to know what it is; I can name a variable "Fred" or a 50-char string class "Bubba" if
> I want to, and it doesn't matter - because nobody else needs to understand what those
> names mean.  However, if I'm writing a document that I'm going to send somewhere
> else for Joe to deal with, I'd better use names that Joe can understand and easily map.
> (For an HTML example, I like "BQ" much more than "BLOCKQUOTE" as an element
> name - but if I use BQ in my code, no UA will know what I'm talking about because BQ
> isn't defined anywhere.  If, OTOH, I slip a transformative preprocessor that morphs BQ
> into the defined BLOCKQUOTE somewhere between authoring and the public UA, that
> works fine.)

Packages are heavily reused and refer to the public declarations of other packages.

In Java, methods only to be used within a package are not given scope beyond that package and
can be renamed as desired.  But software packages would be quite useless without a significant
number of public declarations.

For example, take the W3C DOM Java bindings which exists almost purely of public
declarations.  It declares such common public names for use as "Document", "Comment", "Attr".
There are numerous conflicts between these compiled interface class names and classes in the
applications I use them in.  Without package name qualification of the classes, the situation
would be quite difficult not only distinguishing between ambiguous names, but also just trying
to keep track of which standard each class belonged to.

IMO, this is exactly what happens with XML, mixing different standard elements and
architectural forms from different specs in a single DTD or content model to produce a desired
result.

> The difference you're looking for is one of scope.  Internal names don't matter to the
> outside world, because nobody outside has to do anything with them...but external
> names MUST be defined in some way, else nobody outside CAN do anything with
> them.  Am I expressing it clearly?

No.  Java packages typically have lots of external names that matter to the outside.

Ray Whitmer
ray@x...



xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@i...
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on CD-ROM/ISBN 981-02-3594-1
To unsubscribe, mailto:majordomo@i... the following message;
unsubscribe xml-dev
To subscribe to the digests, mailto:majordomo@i... the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa@i...)



PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.