lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re[2]: [lmi] Code review: product editor


From: Vadim Zeitlin
Subject: Re[2]: [lmi] Code review: product editor
Date: Mon, 12 Mar 2007 18:26:22 +0100

On Mon, 12 Mar 2007 17:19:44 +0000 Greg Chicares <address@hidden> wrote:

GC> Why don't we just write two separate typesafe class templates:
GC>   template<typename ValueType> UnidimensionalTable;   // MultiDimTable1
GC>   template<typename ValueType> MultidimensionalTable; // MultiDimTable7
GC> without any metaprogramming?

 The main reason is that it would be impossible to reuse the code to
implement another table. I.e. everything will be completely hardcoded. And
another reason is that there will be some code duplication between
UnidimensionalTable and MultidimensionalTable as they won't be able to
just use the same generic class any more then.

GC> But we don't need to make the axes generic. There are only two cases:
GC>  (1) one single axis;
GC>  (2) one single set of multiple axes.
GC> In case (2), the axes are always the same. If we ever add a new axis,
GC> we'll add it for all entities. Thus, MultiDimTable7 might become
GC> MultiDimTable9 (which is why I'd rename it as above), but we won't have
GC> both MultiDimTableX and MultiDimTableY (for X!=Y!=1) at the same time.
GC> We can hardcode the axes.

 I see. It looks we really did complicate the code too much here then,
just as I was afraid. I still feel slightly sad breaking what looked
like nice and generic interface (which might be potentially useful for
display of other data and not only in the product editor BTW) and replacing
it with the hard coded axis set but if you're absolutely sure that we're
never going to need these classes for anything but the product editor, so
be it.

 Could you just please confirm it for the very last time?

 Thanks,
VZ





reply via email to

[Prev in Thread] Current Thread [Next in Thread]