Possreps - still trying to see the value

From: Marshall <marshall.spight_at_gmail.com>
Date: 4 Mar 2007 11:07:33 -0800
Message-ID: <1173035253.024180.17840_at_j27g2000cwj.googlegroups.com>



Okay, we mentioned possreps in passing in a recent thread. I'm still unclear on their value. Thought I'd try to talk it through and see what happens.

The canonical example seems to be polar vs. cartesian. Bob used complex numbers the other day but I think 2D points is a bit more familiar.

What operators are associated with 2D points? We would at least like to be able to get the x and y values. If we are thinking in polar terms, then the radius and angle also come immediately to mind. What else?

Probably we'd like to have some arithmetic of points: translate, rotate, scale. Dot product? Etc. (There's some question lurking nearby about the difference between a vector and a point; let's explicitly leave that out of this discussion, please.)

So, are all these things present and accessible to client code in both forms? Is there any difference between the two possreps other than the performance characteristics of the associated functions? If there isn't any other difference, it seems to me that means that possreps are part of the physical layer, and if that's the case, I don't see why they should be visible in the client code.

If possreps are visible at the logical layer, then what do they provide that I wouldn't have otherwise? If instead of formalizing the point type, I instead used a tuple, either (x,y) or (t,r), and I had the full suite of functions I need defined on both forms, what don't I have that I would have with possreps? Hot swap? Couldn't I get that, or almost that, with the tuple type? I could certainly modify existing relvars in place. There might be some adjustment necessary in client code, but I suspect even that could be automated. Perhaps *that* is the value of possreps?

The whole thing seems a lot like the ADTs of yore, or even the idea of "value objects" that the OO world is starting to talk about now that the pendulum is swinging back in the direction of values.

Any discussion or explanation is appreciated.

Marshall Received on Sun Mar 04 2007 - 20:07:33 CET

Original text of this message