Re: PROPOSAL (round 3): 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: > I agree with Holger. The interface does not make it obvious that > sometimes the content handler is used and sometimes it is not used. I did not say that content handler is not used. In fact, the default implementation of XmiWriter methods in XMIWriter would _use_ content handler - thus in case when a non-default content handler is set, they would ignore the output stream. > I also think that XMIReader is trying to be too many things at once. > Sometimes it is a SAX content handler and sometimes it is an interface > to I/O stream-based I/O. "extent" is a property for the SAX-related > stuff, but it is a parameter for the JMI-defined stuff. I don't think > that it will be the case very often that one will use XMIReader to read > a SAX stream _and_ then also use it to read in InputStream. So, I think > all the SAX content handler stuff should be factored out into a seperate > interface like so: OK, it seems that we are moving back and forth. I don't see why it is a problem to have both types of methods in one class. But in my original proposal, I explained how JMI XmiReader and XmiWriter interfaces will be implemented by our implementation of XMIReaderFactory and XMIWriterFactory which I am still planning on doing. The XMIReader and XMIWriter interfaces did not extend XmiReader and XmiWriter. I added the inheritance mainly because of your comments. If you wish, I can revert it back and remove inheritance from XmiReader/XmiWriter from our XMI interfaces. This will also solve your problem with the xmiVersion parameter - JMI write methods will disappear from XMIWriter - i.e. xmiVersion will not be a parameter of any write method anymore. The disadvantage of that is that you will lose ability to use the extended features like reference resolver or reference provider with standard interfaces. I don't like adding two more interfaces. If we come to a conclusion that the current set of interfaces/abstract classes is not enough, I would rather abandon the whole idea of ContentHandlers and return back to simple reader and writer. Martin