Re: Plot idl



Havoc Pennington wrote:
> 
> Hi,
> 
> Thought I'd send off this IDL for any comments. I sort of absorbed
> Gnumeric.idl, we can sort out later which definitions are where I guess.
> 
> Havoc
[idl snipped]

Hi Havoc,

I had a few moments, so I read the IDL you were kind enough to write.  I
have a few humble suggestions you might want to consider.  I've only
been lurking on the gnumeric list for a little while, so please forgive
me if these issues have been raised before.  Without further ado, and in
no particular order:

1.  You make heavy use of attributes.  This saves you the trouble of
having to write separate get/set IDL interfaces for each field. 
Unfortunately, attributes can't throw exceptions.  This may not seem
like a problem at the moment, but if you *ever* need to throw an
exception when an attribute is read or written, you will have to change
the IDL and, as a result, all of the clients and servers which use it. 
I ran into exactly this scenario when I wanted to allow some clients but
not others to access my attributes.  There may be other circumstances as
well.

2.  Possible performance issues with get_value() and set_value().  If I
want to get or set a large contiguous set of values, I will need to call
these methods many times.  Doing this through CORBA can be very slow. 
You might be better off with something like this:

  Values get_values(in unsigned long start_index, in unsigned count)
    raises (OutOfRange)

  void set_values(in unsigned long start_index, in Values value)
    raises (OutOfRange)

3.  Different ValueTypes on the same Axis.  What should a Plot
implementation do with an axis that contains both strings and doubles? 
It could convert them all to strings, I suppose, but if only one of them
is a string, it is probably an error on the part of the user or caller. 
More importantly, you are forcing the Plot implementations to check and
coerce each of the values.  While multiple ValueTypes for each cell in a
spreadsheet makes sense, I'm not sure that it make sense for the data on
the same axis in a plot.  I would force the caller (e.g. the
spreadsheet) to check and coerce the values as necessary for each type
of plot.  After all, the caller is usually in a better position to
determine what type of coercion if any should take place.

4.  One array of values per axis.  I often want to plot multiple
y-values for a given x.  The existing TwoDPlot interface does not allow
that.  A MultiTwoDPlot interface (with multiple y-axes) would workaround
this, but I would still need to specify the start and stop values for
each axes separately.  Moreover, I may want to the start and stop values
determined automatically by the plot.  I recommend having each type of
plot consist of the appropriate Axis descriptions (start/stop, auto,
tick spacing, etc.) and separate homogeneous values arrays.  For
example:

  interface BarGraph : Plot {
    // I will use attributes to keep it short
    attribute CategoricalAxis x_axis;
    attribute ScalarAxis y_axis;
    
    attribute StringValues x_values;
    typedef sequence<ScalarValues> ScalarValuesSeq;
    attribute ScalarValuesSeq y_values_sequence;
  }

Anyway, that my $.02 worth.  I hope its helpful.

-- Dean

+--------------------------------------------------------------------+
|    Dean Brettle Computer Consulting     http://www.brettle.com/    |
|      Contract development and support of software and systems      |
+--------------------------------------------------------------------+



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