On Fri, Oct 19, 2001 at 12:02:19PM +0200, Jean-Marc Lasgouttes wrote:
> I'm not sure this would be so easy. I will be ad-hoc structure with
> the things needed by such and such method. I do not like that either.

One could start with exactly that kind of structure. But than, magically,
the interface to these nether parts _looks_ cleaner, since you just have
this "opaque" structure. So you get the opportunity to clean up above, and
when you are done, you are going to clean the dirty corners in the lower
parts one by one.

[And you can use a lot of forward declarations instead of including whole
headers (especially true for enums)...]

> See what happens with the Inset method which get some random new
> argument just because one of the insets needs some info. This is not
> very nice.

[If there are lots of things needed only by specific insets, the
architecture is broken anyway]

> Another case where this would help me is in the quote inset, where I
> need to know the current language to output the correct latex. This is
> a case where DrawInfo would not be enough. So a better solution would
> be to pass a BufferParam and a cursor to all those methods, but this
> is still very heavy.

So put the language it in the DrawInfo. Most insets won't care about the
language and simply ignore it, but the quote inset will get all it needs.
And it's cheap: You set up the drawinfo in the beginning once and pass it
around as reference.

> Andre> I really don't like the "owner_" stuff used all over the place
> Andre> in the outside world since this assumes that some "lower"
> Andre> structure knows something about some structure "above". 
> 
> I can understand that.

[It makes the "split the mess, clean up above, clean up below" approach 
much harder, since you can't really split]

> Andre> This does not only break encapsulation (we have some compile
> Andre> time problem, haven't we?),
> 
> No, because you do not need the paragraph.h header in to add a
> Paragraph* member.

As soon as enums are needed, you are doomed. And don't argue this does not
happen: Have a look at  *::localDispatch(). We include _250_ symbols from
commandtags.h just to be able to write a _declaration_ of localDispatch...

And btw: you mess up everything with the explicit usage of "Paragraph *".
I thought we were going into the direction of STL containers with
value-semantics. Naked pointer go exactly in the opposite direction.

> Andre> but results in a very fragile architecture, too.
> 
> I thin that in this case one knows exactly when this member can be
> set.

*shrug* I don't like handling special cases at all. Everytime I write a
'if' I think there's something wrong with the logic...

> Actually I'd like to have Lars' take on the question before going
> ahead.

Ok ;-)

Andre'

-- 
André Pönitz .............................................. [EMAIL PROTECTED]

Reply via email to