Perl6::MetaModel Diagrams


< back

A more complex Shape example using Roles, here is the basic code.

    
    role Shape {}
    role Shape3D does Shape {}
    
    class Square does Shape {}
    class Square3D is Square does Shape3D {}    
    
    class Rectangle is Square does Shape {}
    class Rectangle3D is Rectangle does Shape3D {}        
    
    class Circle does Shape {}
    class Circle3D is Circle does Shape3D {}            
    

Again, note the mirrored eigenclass hierarchy, along with the roles.


© Copyright 2005 Stevan Little