On Mon, Oct 14, 2002 at 01:56:02PM +0100, John Levon wrote: > That'd certainly be a massive improvement on the current ugliness, but > it still has the problems of C++ output, like inflexibity and > awkwardness (not to mention lots of extra code).
The visitor pattern does not solve any problem, it just shifts focus. To translate it in to LyX: It would be appropriate if the "formats" are large chunks of self-contained code which only need to access inset-internal stuff using a slim interface. However, the situation is exactly the other way round: the "formats" consists of thin wrappers around std::ostream ([actually should be streambuf implementations, but that's another issues]), but need to have full access to each inset's internal data. This is exactly the situation where the visitor pattern does not buy anything and would only incur additional costs for the accessors and for the pattern itself (which - contrary to the "built in" inheritance) needs to be implemented manually. Andre' -- Those who desire to give up Freedom in order to gain Security, will not have, nor do they deserve, either one. (T. Jefferson)