Re: PROPOSAL (round 2): Extensions to MDR XMI API

Brian Smith <[email protected]>
Newsgroups gmane.comp.java.netbeans.modules.mdr.devel
Message-ID <[email protected]>
Martin Matula wrote:
>> 3. How are document URI's to be compared? Are they just compared by
>> String.equals(), or is any URI canonicalization done?
> 
> What canonicalization do you mean?

Now that I think about it, canonicalization would be probably way to 
complicated. For an explanation of what I meant, please see the 
definition of URI equality given at: 
http://java.sun.com/j2se/1.4/docs/api/java/net/URI.html#equals(java.lang.Object)

>> 9. Shouldn't XMIWriter.getObjects() be in OutputTarget? Otherwise, I 
>> wouldn't be able to use the same XMIWriter to write multiple 
>> documents. 

Okay, you said you are likely to get rid of OutputTarget. But I am still 
wondering about what getObjects() is for. Why did you want getObjects() 
to be a property, instead of a parameter to the write() method like was 
done for JMI? I can kind of understand the XMI version being a property, 
but I wonder if the benefit is worth being inconsistent with JMI. It 
seems like you could make the write methods like this:

void write(org.xml.sax.ContentHandler handler, Collection objects,
           String xmiVersion);
void write(org.xml.sax.ContentHandler handler, RefPackage extent,
            String xmiVersion);

This would make the MDR API very similar to the JMI XmiWriter API. And 
also, I can better see how I could reuse an XMIWriter instance to write 
multiple documents with different collections of objects. Also, it seems 
like XMIWriters could then implement XmiWriter too. Similar comments 
apply to XMIReader.

>> 12. I am confused about OutputTarget.getSystemId(). Is this the same 
>> as XMIReference.getDocumentURI()? What is the difference? Similarly, 
> 
> Again - it was taken from InputSource. SystemId is InputSources name for 
> URI I guess, so yes, systemID is identical to documentURI.

Perhaps then XMIReference.getDocumentURI() should be renamed to 
getSystemId() for consistency's sake. I wasn't taking consistency with 
JAXP and SAX into consideration when I suggested the getDocumentURI() 
method.

- Brian
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.