Details
-
New Feature
-
Status: Closed
-
Major
-
Resolution: Implemented
-
1.16.2
-
None
-
None
Description
For regular action mixins, we currently write:
@Mixin(method="act") public class Contributee_someAction() { private final Contributee contributee; // constructor omitted @Action(...) @ActionLayout(...) public ReturnValue act(.... ) { ... } }
instead, the proposal is:
@Action(...) // presence of Action on class implies this is a mixin; @ActionLayout(...) public class Contributee_someAction() { private final Contributee contributee; public ReturnValue act( ... ) { ... } // no need for annotations here. "act" assumed }
The details of the @Action and @ActionLayout facets are "copied" down to the "act" method.
for properties, we currently write:
@Mixin(method="prop") public class Contributee_someProperty() { private final Contributee contributee; @Action(semantics=SAFE) // required @ActionLayout(contributed=ASSOCIATION) // required @Property(...) @PropertyLayout(...) public ReturnValue prop( /* no args */ ) { ... } }
instead we'd rather write:
@Property(...) // implies this class is a mixin @PropertyLayout(...) public class Contributee_someProperty() private final Contributee contributee; public ReturnValue prop() { ... } // "prop" is assumed }
The boilerplate (and confusing) @Action(SAFE) and @ActionLayout(AS_ASSOCIATION) are implied. The facets from @Property and @PropertyLayout are copied down to the "prop" method
And finally, for collections, we currently write:
@Mixin(method="coll") public class Contributee_someCollection() { private final Contributee contributee; @Action(semantics=SAFE) // required @ActionLayout(contributed=ASSOCIATION) // required @Collection(...) @CollectionLayout(...) public List<ReturnValue> coll( /* no args */ ) { ... } }
instead we'd rather write:
@Collection(...) // implies this class is a mixin @CollectionLayout(...) public class Contributee_someCollection() private final Contributee contributee; public List<ReturnValue> coll() { ... } // "coll" is assumed }
similar to properties.
Attachments
Issue Links
- is related to
-
CAUSEWAY-2318 [CANNOT REPRODUCE] Regression on Mixins: @Action at method level no longer honor association
- Closed
-
CAUSEWAY-2335 Mixins declared using type-level @Action should not contribute as Association
- Closed