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

Dan Haywood commented on ISIS-1157:
-----------------------------------

Hi Oscar, I reviewed the code but decided there's a much easier way... simply 
add the caching to the existing ActionInvocationFacet (to be precise: 
ActionInvocationFacetForDomainEventAbstract).  I also don't think there's any 
need for a new ActionRequestCachedResultFacet; simply use the 
ActionSemanticsFacet.

I've gone ahead and made this change, and I've also added an integration test 
to the isis-app-kitchensink:

https://github.com/isisaddons/isis-app-kitchensink/blob/6067ac27a6f4c399730d18095c419fd67be55a21/integtests/src/test/java/org/isisaddons/app/kitchensink/integtests/modules/semantics/SemanticsObjectIntegTest.java#L80

documentation also updated:

http://isis.apache.org/guides/rg.html#_rg_annotations_manpage-Action_semantics

If you're happy, perhaps you can close the PR (because it won't get closed 
automatically as the change doesn't merge in your commits).

> Cache safe Actions results by annotating them
> ---------------------------------------------
>
>                 Key: ISIS-1157
>                 URL: https://issues.apache.org/jira/browse/ISIS-1157
>             Project: Isis
>          Issue Type: Improvement
>          Components: Core
>    Affects Versions: core-1.8.0
>            Reporter: Oscar Bou
>            Assignee: Oscar Bou
>             Fix For: 1.9.0
>
>
> As discussed on the Isis mailing list [1].
> Currently, there's service called QueryResultsCache [2] that allows to cache 
> the results of an Action/method invocation.
> We want to introduce this capability for Safe Actions by simply annotating 
> them.
> Current proposal is to extend the "SemanticsOf" annotation param with a new 
> type: SemanticsOf.SAFE_AND_REQUEST_CACHED
> A usage example would be:
>  
> {code}
>     @Override
>     @Action(semantics = SemanticsOf.SAFE_AND_REQUEST_CACHED)
>     public SortedSet<IESG> relevantSnpGenotypes(final IE inputElement,
>             final Kit kit) {
>         if (kit != null) {
>             return 
> kit.findAllAssociatedSNPGenotypesForInputElement(inputElement, 
> AlgorithmImplementation.this.IESGClass);
>         } else {
>             return Sets.newTreeSet();
>         }
>     }
> {code}
> [1] 
> http://mail-archives.apache.org/mod_mbox/isis-users/201505.mbox/%[email protected]%3E
> [2] https://isis.apache.org/reference/services/query-results-cache.html



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to