You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@isis.apache.org by "ASF subversion and git services (Jira)" <ji...@apache.org> on 2019/12/12 10:19:00 UTC
[jira] [Commented] (ISIS-1998) Simplify syntax way for mixins, to
better express intent using @Action, @Collection and @Property
[ https://issues.apache.org/jira/browse/ISIS-1998?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16994486#comment-16994486 ]
ASF subversion and git services commented on ISIS-1998:
-------------------------------------------------------
Commit b4d92bd2dff1c9b9a2c82c5ec3b17423de627b68 in isis's branch refs/heads/master from Andi Huber
[ https://gitbox.apache.org/repos/asf?p=isis.git;h=b4d92bd ]
ISIS-1998: fixes regression from too aggressive optimization
even though when @Action is mandatory, Mixins now can provide actions,
that do not need to be annotated at method-level
> Simplify syntax way for mixins, to better express intent using @Action, @Collection and @Property
> -------------------------------------------------------------------------------------------------
>
> Key: ISIS-1998
> URL: https://issues.apache.org/jira/browse/ISIS-1998
> Project: Isis
> Issue Type: New Feature
> Affects Versions: 1.16.2
> Reporter: Daniel Keir Haywood
> Assignee: Andi Huber
> Priority: Major
> Fix For: 2.0.0
>
>
> For regular action mixins, we currently write:
> {code}
> @Mixin(method="act")
> public class Contributee_someAction() {
> private final Contributee contributee; // constructor omitted
> @Action(...)
> @ActionLayout(...)
> public ReturnValue act(.... ) { ... }
> }
> {code}
> instead, the proposal is:
> {code}
> @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
> }
> {code}
> The details of the @Action and @ActionLayout facets are "copied" down to the "act" method.
> for properties, we currently write:
> {code}
> @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 */ ) { ... }
> }
> {code}
> instead we'd rather write:
> {code}
> @Property(...) // implies this class is a mixin
> @PropertyLayout(...)
> public class Contributee_someProperty()
> private final Contributee contributee;
> public ReturnValue prop() { ... } // "prop" is assumed
> }
> {code}
> 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:
> {code}
> @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 */ ) { ... }
> }
> {code}
> instead we'd rather write:
> {code}
> @Collection(...) // implies this class is a mixin
> @CollectionLayout(...)
> public class Contributee_someCollection()
> private final Contributee contributee;
> public List<ReturnValue> coll() { ... } // "coll" is assumed
> }
> {code}
> similar to properties.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)