Re: PROPOSAL (round 2): Extensions to MDR XMI API
Martin Matula <[email protected]>
| Newsgroups | gmane.comp.java.netbeans.modules.mdr.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi Brian, Brian Smith wrote: > 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. For XMIReader it is needed to have extent as a property, for the case when you want to use it as ContentHandler. I used the same approach automatically also in the XMIWriter to keep them consistent. I agree that it would be probably more appropriate to make it a parameter rather than a property for XMIWriter. That multiplies number of write methods in XMIWriter by 2. Martin