[email protected] wrote: > Hi all, > > I was looking into the code of the Writer module and was wondering if > there was any intent behind the use of XUnoTunnel. My first > investigations make me think that it is extensively used to try to > guess the real class of an object, although there are some places > where we really do not care of it... I've found a place where a hole > bunch of code (about 90 lines of code) could be replaced by only 1, > just by using the provided interface. Not to mention the places where > a well defined interface could provide some other cuts in the code... > This is not only a problem of size, but it seems to me that it is > unnecessarily complex (thus lowering the maintainability of the code) > and really unefficient. Does someone who is familiar with Writer code > has any idea on this? Is this already part of the refactoring tasks > already underway in some CWS?
When we added UNO APIs to our code it already existed for many years. Not every existing code module was reimplemented based on the created APIs (the only module I know that got reimplemented nearly completely was sfx2). Instead of that we often implemented API wrappers that bridged it to the existing code that still used the C++ implementation classes. To keep this code working it was necessary to retrieve implementation class pointers from objects passed to the code via API. This is the purpose of the XUnoTunnel interface. BTW: this is not special to the Writer code, it can be found in all "old" code modules. While this seemed to be a good idea in the first place (it enabled us to provide API implementations pretty fast without touching the "original" code, thus lowering the regression risk) it now looks as if that wasn't the best idea we had. ;-) At least it prevented the developers from implementing the API more efficiently and - perhaps even more important - using it in their own code (this surely would have rised the quality of the API design and implementation). Moreover, in some places the XUnoTunnel trick was used even if it wasn't necessary. So finding and fixing these places would be nice. We will be glad to receive hints and patches and your issue 99508 seems to be a great start. Thanks! Mathias -- Mathias Bauer (mba) - Project Lead OpenOffice.org Writer OpenOffice.org Engineering at Sun: http://blogs.sun.com/GullFOSS Please don't reply to "[email protected]". I use it for the OOo lists and only rarely read other mails sent to it. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
