[
https://issues.apache.org/jira/browse/ISIS-2234?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Daniel Keir Haywood updated ISIS-2234:
--------------------------------------
Description:
This is somewhat similar to ISIS-1656, which is to flush audit/publishing etc
at the end of the ACTION phase, rather than the RENDER phase.
More broadly stated: RENDERing shouldn't have any side-effects.
~~~
Looking at the code today, we can see that in OneToOneAssociationMixedIn
there's a hack:
{code:java}
@Override
public ManagedObject get(
final ManagedObject mixedInAdapter,
final InteractionInitiatedBy interactionInitiatedBy) {
val mixinAdapter = mixinAdapterFor(mixinType, mixedInAdapter);
return getPublishingServiceInternal().withPublishingSuppressed(
() -> mixinAction.executeInternal(
mixinAdapter, mixedInAdapter, Can.empty(),
interactionInitiatedBy)
);
}
{code}
which prevents the action invocation in the render phase from publishing
anything.
However, inspection of the internal data structures does currently show that
the Interaction executionGraph (push, pop) gets populated, there is no
corresponding hack... see attached screenshot, that shows a number of
executions for all of the contributed properties of a SimpleObject. This isn't
harmful per se, but it is odd that we spend all this effort to create the
execution graph for it to be consumed by no-one at all.
The bottom line is that actions don't know which phase they are being executed
in, and so they do all this extra work.
Perhaps the solution might be to include the phase in the InteractionContext,
so we can therefore avoid this unnecessary work populating the executionGraph.
was:
This is somewhat similar to ISIS-1656, which is to flush audit/publishing etc
at the end of the ACTION phase, rather than the RENDER phase.
More broadly stated: RENDERing shouldn't have any side-effects.
~~~
Looking at the code today, we can see that in OneToOneAssociationMixedIn
there's a hack:
{code:java}
@Override
public ManagedObject get(
final ManagedObject mixedInAdapter,
final InteractionInitiatedBy interactionInitiatedBy) {
val mixinAdapter = mixinAdapterFor(mixinType, mixedInAdapter);
return getPublishingServiceInternal().withPublishingSuppressed(
() -> mixinAction.executeInternal(
mixinAdapter, mixedInAdapter, Can.empty(),
interactionInitiatedBy)
);
}
{code}
which prevents the action invocation in the render phase from doing anything.
However, inspection of the internal data structures does currently show that
the Interaction executionGraph (push, pop) gets populated.
... the bottom line is that actions don't know which phase they are being
executed in.
Perhaps the solution might be to include that info in the InteractionContext ???
> During the render phase, don't populate the execution call graphs with
> results of mixins being invoked.
> -------------------------------------------------------------------------------------------------------
>
> Key: ISIS-2234
> URL: https://issues.apache.org/jira/browse/ISIS-2234
> Project: Isis
> Issue Type: Improvement
> Reporter: Daniel Keir Haywood
> Priority: Minor
> Fix For: 2.3.0
>
> Attachments: screenshot-1.png
>
>
> This is somewhat similar to ISIS-1656, which is to flush audit/publishing etc
> at the end of the ACTION phase, rather than the RENDER phase.
> More broadly stated: RENDERing shouldn't have any side-effects.
> ~~~
> Looking at the code today, we can see that in OneToOneAssociationMixedIn
> there's a hack:
> {code:java}
> @Override
> public ManagedObject get(
> final ManagedObject mixedInAdapter,
> final InteractionInitiatedBy interactionInitiatedBy) {
> val mixinAdapter = mixinAdapterFor(mixinType, mixedInAdapter);
> return getPublishingServiceInternal().withPublishingSuppressed(
> () -> mixinAction.executeInternal(
> mixinAdapter, mixedInAdapter, Can.empty(),
> interactionInitiatedBy)
> );
> }
> {code}
> which prevents the action invocation in the render phase from publishing
> anything.
> However, inspection of the internal data structures does currently show that
> the Interaction executionGraph (push, pop) gets populated, there is no
> corresponding hack... see attached screenshot, that shows a number of
> executions for all of the contributed properties of a SimpleObject. This
> isn't harmful per se, but it is odd that we spend all this effort to create
> the execution graph for it to be consumed by no-one at all.
> The bottom line is that actions don't know which phase they are being
> executed in, and so they do all this extra work.
> Perhaps the solution might be to include the phase in the InteractionContext,
> so we can therefore avoid this unnecessary work populating the executionGraph.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)