an idea about possreps

From: Marshall <marshall.spight_at_gmail.com>
Date: Sat, 2 Feb 2008 20:31:09 -0800 (PST)
Message-ID: <f161d648-1886-4a47-a12e-9243e6000ae8_at_h11g2000prf.googlegroups.com>



I just had this idea about possreps.

In another context, someone discussing methods, or functions that are bound very closely to a specific type, commented that he thought that such functions should be extremely limited, rather than the grab-bag that OOP usually produces. I thought this a rather interesting comment, and after thinking about it for a long time decided it was a good comment, but that I didn't really know how to measure how well a design achieved that goal. Looking at, say, java.util.String, it is clear that many of its methods are not all that essential. charAt() or getBytes() seem fairly intrincic, but something like toUpperCase() doesn't seem to have much to do directly with the type, and something like split() seems to be overkill.

It is more or less sensible in OOP to put all these things in the class; it's common practice and it's also convenient. But that's not the same thing as essential.

I vaguely sense that what D&D are thinking about with their THE_ operators is the same thing as I'm thinking of as the essential methods.

The idea I had was simply this: that the essential operators are exactly those that return selector arguments. This is clearly necessary to convert from one possrep to another; what's less clear is if that case necessarily has to be exposed. (That code might only exist under the covers in the possrep implementation.) It's also unclear if it's sufficient.

Marshall

PS. This idea just popped in to my head; hence it is not very mature. Received on Sun Feb 03 2008 - 05:31:09 CET

Original text of this message