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 2021/07/26 13:02:00 UTC

[jira] [Commented] (ISIS-2329) Support nested non-static mixins, with domain event class declared within.

    [ https://issues.apache.org/jira/browse/ISIS-2329?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17387332#comment-17387332 ] 

ASF subversion and git services commented on ISIS-2329:
-------------------------------------------------------

Commit 7605ef206d2e3a9826c0ea4ad8eb8c89d10f71d2 in isis's branch refs/heads/ISIS-2329 from danhaywood
[ https://gitbox.apache.org/repos/asf?p=isis.git;h=7605ef2 ]

ISIS-2329: adds 1-arg constructors for domain events


> Support nested non-static mixins, with domain event class declared within.
> --------------------------------------------------------------------------
>
>                 Key: ISIS-2329
>                 URL: https://issues.apache.org/jira/browse/ISIS-2329
>             Project: Isis
>          Issue Type: Improvement
>          Components: Isis Applib (programming model)
>    Affects Versions: 2.0.0-M3
>            Reporter: Daniel Keir Haywood
>            Priority: Minor
>             Fix For: 2.0.0-M6
>
>
> To support this, need to allow action domain events to have 1-arg constructor, being the mixee. 
> eg, at the moment, in simpleapp, I can refactor updateName into a mixin:
> {code:java}
> public static class UpdateNameActionDomainEvent 
>   extends SimpleModule.ActionDomainEvent<SimpleObject.updateName> { }
> @Action(semantics = IDEMPOTENT,
>         command = CommandReification.ENABLED, publishing = Publishing.DISABLED,
>         associateWith = "name", domainEvent = UpdateNotesActionDomainEvent.class)
> public class updateName {
>     public SimpleObject act(@Name final String name) {
>         setName(name);
>         return SimpleObject.this;
>     }
>     public String default0Act() {
>         return getName();
>     }
> }
>  {code}
> but the  UpdateNameActionDomainEvent has to remain outside for now.  Instead, I'd like to write:
> {code:java}
> @Action(semantics = IDEMPOTENT,
>         command = CommandReification.ENABLED, publishing = Publishing.DISABLED,
>         associateWith = "name", domainEvent = UpdateNotesActionDomainEvent.class)
> public class updateName {
>    public class UpdateNameActionDomainEvent 
>      extends SimpleModule.ActionDomainEvent<SimpleObject.updateName> { } 
>     public SimpleObject act(@Name final String name) {
>         setName(name);
>         return SimpleObject.this;
>     }
>     public String default0Act() {
>         return getName();
>     }
> }
>  {code}
> The fix should be quite simple: improve the instantiation logic in DomainEventHelper to handle events with 1 arg as well as 0 args and 3 args.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)