Re: [guppi-list] Re: text import glitch



On Tue, Mar 30, 1999 at 10:47:25AM -0500, Havoc Pennington wrote:
> On Tue, 30 Mar 1999, Asger K. Alstrup Nielsen wrote:
> > Regarding the new type tags:  In my code, I explicitly manage
> > the DataSet and DataConverters outside of goose scope.  I thought
> > that Jon preferred to make the DataSets DataConverter ignorant,
> > and that makes sense to me.

A few notes on generality and abstraction in goose, as I see it.

The whole string interface (add_string(), as_string(), etc.) is meant
to allow simple applications to be completely type-agnostic.  So for
example, you could build a basic data browser that doesn't know
anything about an object other than that it has inherited from
DataSet and doesn't have to fool around with templates.

Modular DataConverter stuff is a good thing because:
(1) Modularity a priori a good thing.
(2) Having things done modularly will hopefully simplify i18n.
(3) Different DataSet subclasses will eventually need to convert data
    in the same way.
Example of (3): We might want to have a CircularSet container for
holding circular data (i.e. sets of observations of angles).  This is
basically just a bag of numbers, like the RealSet.  However, it is a
bag of numbers between 0 and 2pi, and the statistical methods you want
to apply to it are different: some RealSet ops don't make sense when
applied to a CircularSet, and vis versa.  Therefore you can't derive
one from the other, but you do want them to share a converter.

Sometimes you just have no choice but to down-cast.  Guppi, for
example, needs to know that certain things that should be a RealSet
are in fact a RealSet.  Now maybe it would be more correct to use a
dynamic_cast<> for that.  But as long as you don't use them stupidly,
the introduction of magic numbers can make life easier... so why not
put them in and at least open up that option.

-JT



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