meetings/working-groups/roles/roles-2023-02-15.md
In the proposal so far, we have a single base type list, which starts with an underlying type and then continues with a mix of roles and interfaces.
role R : UnderlyingType, BaseRole1, Interface1, BaseRole2, Interface2
This feels complicated and error-prone.
For example, you might not notice that you forgot to specify an underlying type
since interfaces are allowed as underlying types.
role R : IUnderlyingInterface, Interface1, Interface2
Options:
I).role R : BaseRole(s), Interface(s)
An issue is that order now affects meaning:
role R : BaseRole1, Interface1 vs. role R : Interface1, BaseRole1view VJsonView on type : views, interfaces
view VCustomer extends type : view, interfaces
view VJsonView of type : views, interfaces
This provides an advantage for partials (keyword allows making underlying type optional with less ambiguity):partial R : UnderlyingType, Interface1
partial R : Interface2 (currently error since missing underlying type)
We could also deal with an optional underlying type when base role(s) is present:view VCustomer : views, interfaces // infer
extension of type : views, interfaces // optional extension name
role of type ... // disallowedDecision: let's go with (4)
Here are some keywords we considered:
extension E of Uextension E extends U (too verbose)extension E on Uextension E for Uextension E over Uthis E of Uextension E is Uextension E override U (misleading since no virtual/inheritance)extension E using U (two meanings for using already, not intent)extension E from UA few keywords stand out as potential candidates:
of suggests a property of the underlying thing
on suggests something added "on top of"
for is more like natural/English language (we have extensions for this type)
Here's what those could look like in context:
role R of Uview V of Urole R on Uview V on Uview V for Uextension V for Uextension Extension<T> for TDecision: let's go with for. of would be second choice, on third.
We've considered a few candiates so far, but need a firmer decision since we're working on implementation.
roleview (this unfortunately already has connotations in various fields, from databases, UI, etc, but some of those can be misleading)shapealias (ambiguity with using aliases; empty roles are better aliases)implicit and explicit:explicit extension Role for U (it's a bit long-winded but makes it clear that they are variations of same feature)explicit view Role for U, implicit view Extension for UDecision: let's go with 5A