Debtags Library

Benjamin Mesing bensmail@gmx.net
Sun, 11 Jul 2004 17:24:47 +0200


Hello,


> > much overhead. I don't know about the performance of such an solution as
> > it would involve virtual function calls, but it might be a good generic
> > solution. I've attached a screenshot to clarify what I mean.
> 
> Since you can do that easily without virtual (and probably you
> won't need any additional memory) i think not using virtual functions
> is better here (and expected to be faster, too)
> 
> just use a pointer to the children list. If the pointer is NULL,
> then there are no children, thus the size is 0. Otherwise, return the
> size value of the children list (which probably already has a length
> counter, no need to make a duplicate for that).
You are right, in our case where performance might be essential -
perhaps it would be best to dismiss the TagIF and place the Tag there.
This would avoid overhead when everything is treated as tags even though
we loose some flexibility. The facet would simply be a specialization of
the Tag then. It might still be useful to add RTTI to the system, so
that a Tag could be downcasted to a facet if we actually need to know
whether we have a tag or not. 
Of course we could add a function isFacet() in the Tag class and do a
static_cast if space restrictions are really essential, but again we
would loose flexibility (perhaps we want to add a class "Distribution"
to allow us to assemble distributions (like "Server" or "Home User")
later). In this case we would have to add an isDistribution function in
the Tag class .

But lets see what Enrico says to this idea at all...

Greetings Ben