A role does several things (a bit of hand-waving here):
- It might provide behaviour (methods)
- It might require behaviour (acting sort of like an interface)
- Any conflicts (duplicate methods) must be resolved at compile-time
Understanding of roles and their use in specialisation by composition, can be aided enormously by Sandi Metz's talk, "Nothing is Something" (link).
No comments:
Post a Comment