On Thu, Dec 11, 2008 at 8:16 PM, Leon Timmermans <faw...@gmail.com> wrote:
> What I propose is using role composition for *everything*. Most > importantly that includes the roles Readable and Writable, but also > things like Seekable, Mapable, Pollable, Statable, Ownable, Buffered > (does Readable), Socket, Acceptable (does Pollable), and more. "Mapable" is better spelled "Mappable" in English. Arguably, it should be "Stattable" as well; "statable" means "state-able". > That may however make some interfaces is a bit wordy. I think that can > be conveyed using a subset like this (though that may be abusing the > feature). > > subset File of Mapable & Pollable & Statable & Ownable; As Jonathan said, I think composition makes more sense here... but what if you have an interface that expects an IO object and does nothing with it but pass it into some other interface? How does it declare that? It seems like there still needs to be a generic superrole that means "some non-empty but unspecified subset of these roles" - maybe "Closable" would work, but it's not real clear. -- Mark J. Reed <markjr...@gmail.com>