[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Namespace: what's the correct usage?
- From: Martin Gudgin <email@example.com>
- To: Jonathan Borden <firstname.lastname@example.org>,Kohsuke KAWAGUCHI <email@example.com>, firstname.lastname@example.org
- Date: Sat, 19 May 2001 16:52:31 +0100
----- Original Message -----
From: "Jonathan Borden" <email@example.com>
To: "Martin Gudgin" <firstname.lastname@example.org>; "Kohsuke KAWAGUCHI"
Sent: Saturday, May 19, 2001 4:25 PM
Subject: RE: Namespace: what's the correct usage?
> Martin Gudgin wrote:
> > [MJG]
> > Actually, I provided that example because I thought you may be
> > happier with
> > it. In reality I use the class name for the top-level element.
> > Why? Because
> > typically I'm serializing an instance of a class and I probably don't
> > the name of the local variable the class is bound to, indeed a given
> > instance may be bound to multiple local variable names. So I use the
> > name as the localname of the top-level element.
> > In the above the Person instance is sometimes bound to the local name
> > 'martin' and sometimes bound to the local name 'o'. So I use the type
> > for the top level and then the field names of the Person class
> > for the child
> > elements.
> This argument seems hopelessly complicated. The most reasonable way to
> define a person name structure is:
> <person.name xmlns="http://example.org/person">
> why would anyone want to complicate this with different namespaces for
> element of the structure?
I wouldn't 'complicate it with different namespaces for each element in the
structure'. I would qualify the top-level element ( person ) and not qualify
the children. This seems the most natural mapping to
public class person
to me at least...
The text in the previous post was trying to show why I would use 'person' as
the top level element rather than 'marting' or 'o'