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 2015/10/24 13:09:27 UTC
[jira] [Commented] (ISIS-803) Replace lifecycle methods with
additional EventBus events.
[ https://issues.apache.org/jira/browse/ISIS-803?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14972530#comment-14972530 ]
ASF subversion and git services commented on ISIS-803:
------------------------------------------------------
Commit c7d12e30b3685e5d982c818b49ac3d21802e43eb in isis's branch refs/heads/master from [~danhaywood]
[ https://git-wip-us.apache.org/repos/asf?p=isis.git;h=c7d12e3 ]
ISIS-830: new lifecycle events following pattern of existing domain events...
... being abstract and with a Default impl, Also no-arg constructor.
This should make ISIS-803 easier to implement when we get around to it
> Replace lifecycle methods with additional EventBus events.
> ----------------------------------------------------------
>
> Key: ISIS-803
> URL: https://issues.apache.org/jira/browse/ISIS-803
> Project: Isis
> Issue Type: Improvement
> Components: Core
> Affects Versions: core-1.5.0
> Reporter: Dan Haywood
> Assignee: Dan Haywood
> Fix For: 1.11.0
>
>
> This issue is to remove a feature that is only partly implemented in the JDO objectstore, namely the lifecycle methods.
> Jeroen and I were discussing this, and think they are possibly an anti-pattern since they tend to lead to fragile code.
> Rather than have the object "pushing" changes to others, it would be better if an event were broadcast via the EventBus. That way a subscribing service could pull appropriate changes and do whatever is necessary.
> ~~~
> Possible implementation:
> @DomainObject(
> domainEventOnLoad = ...,
> domainEventOnSave = ...,
> domainEventOnUpdate = ...,
> domainEventOnDelete = ...,
> )
> By using the corresponding associated phases, ie EXECUTING and EXECUTED, the subscriber can act BEFORE and/or AFTER the domain object is loaded / initially saved-persisted / updated / deleted.
> The "domainEventOnLoad" event would allow the user to "veto" a specific domain entity instance (domain object) to be showed due to security or other business reasons.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)