|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Name
Represents a Name, with respect to a Namespace.
This interface is method compatiable with QName, to facility those transitioning form XML based models. As we work through these issues with GenericName this interface may be moved to util.
Notes:
I have tried to resolve the usability conflict associated with nameing. The main point of contention seems to be the trouble in maintaining either a linked list, or the trouble in maintaining a chain of namespace. Any overhead of this manner prevents the easy creation of use of Names, something that is required as they are used often. To be blunt any solution where you need to preconfigure a some context for your Name is going to fail. The fact that GenericName is asking us to maintain two
So lets consider - why do we need to know the name and namespace context?
Unfortantly we *need* a pure identify solution, remember that we need Names to be lightweight data objects as they are used as parameters everywhere, flowing between XML Schema, serialized over the wire to client applications and so on.
The following aspects of GenericName prevent this use:We have chosen to implement Name as a pure data object, with equality based on namespace uri and local part. We have not seperated out name into Local/Scoped/Global. Every Name is considered Scoped, a global name simply does not have a namespace uri. There is no connection between names.
We have also not specified a bi directional relationship with Namespace, a namespace may be looked up in a application specific way. For an example practice please see the Schema interface which includes a namespace for its contents.
Method Summary | |
---|---|
boolean |
equals(Object obj)
true if getURI is equal. |
String |
getLocalPart()
Retrieve the Local name. |
String |
getNamespaceURI()
Returns the URI of the namespace for this name. |
String |
getURI()
Convert this name to a complete URI. |
int |
hashCode()
Must be based on getURI(). |
boolean |
isGlobal()
Returns true if getNamespaceURI is null |
String |
toString()
A local-independant representation of this name, see getURI(). |
Method Detail |
---|
boolean isGlobal()
true
if getNamespaceURI is null
true
if getNamespaceURI is null
@UML(identifier="scope", obligation=MANDATORY, specification=ISO_19103) String getNamespaceURI()
In ISO 19103 this is known as scope and containes a backpointer to the containing namespace. This solution is too heavy for our purposes, and we expect applications to provide their own lookup mechanism through which they can use this URI.
The namespace URI does serve to make this name unique and is checked as part of the equals operation.
String getLocalPart()
This mechanism captures the following ISO 19103 concerns:
@UML(identifier="parsedName", obligation=MANDATORY, specification=ISO_19103) String getURI()
This URI is constructed with the getNamespaceURI and getLocalPart().
This method captures the following concerns of GenericName:
As an example:
int hashCode()
hashCode
in class Object
boolean equals(Object obj)
true
if getURI is equal.
equals
in class Object
other
-
true
if getURI is equal.String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |