On Wed, 2005-10-12 at 12:00 -0400, Stevan Little wrote:

> Usefulness aside, why do Roles and Classes need to be seperate  
> beasts? In the current meta-model prototype, the role system is laid  
> atop the class system so that the following is true:
> 
> Class is an instance of Class
> Role is an instance of Class
> Class does Role
> 
> This then means that Role also .does Role since Role is an instance  
> of Class (which does Role).
> 
> It gets very cyclical, but it essentially means that all classes can  
> be treated as roles. This allows for all sorts of interesting things  
> to happen actually.

I've always thought that classes were more specific than roles in that
you can't apply a class to another class.  (Maybe that's the wrong
direction of specificity.  Though I am positive that .does() is more
general than .isa(), I always have to stop and think about which
direction co- and contra-variance goes.)

Certainly I think declaring a class should imply a role of the same
name, even if you can't actually apply that role and mix in state and
behavior.

> I have to admit though, that this comes directly from Scala (so maybe  
> we are not alone here out on the edge :)

I've also heard that Sather does something similar but don't know any
details.

-- c

Reply via email to