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

Matt Frantz commented on TINKERPOP3-701:
----------------------------------------

On the question of how to allow cancellation of a mutation, is it kosher to 
allow a callback to throw an exception for that purpose?  That is, if we have a 
"pre-mutation" event that is propagated to a callback, and that callback raises 
{{MutationCancelledException}}, then we would abort the mutation.  The 
necessary state must be propagated in the specific pre-mutation event class.

An alternative would be to use a boolean return type instead of using 
{{Consumer}} as the callback model.  That might have better performance  when 
lots of mutations are being prevented.

> Improving Mutating Interface
> ----------------------------
>
>                 Key: TINKERPOP3-701
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP3-701
>             Project: TinkerPop 3
>          Issue Type: Improvement
>          Components: process
>    Affects Versions: 3.0.0.GA
>            Reporter: Ran Magen
>            Priority: Critical
>
> This was discussed in the mailing list. Ill quote the relevant parts:
> We want to implement a validation strategy. Sort of like EventStrategy, but 
> it will notify before a mutation, and will enable the user's validation code 
> to cancel a mutation if it doesn't pass its checks. The problem is that there 
> are no "before" callbacks for the Mutating interface.
> Stephen Mallette:
> i may have messed up the Mutating interface design a bit.  looking at it now, 
> i feel like it could be less coupled to the EventStrategy related features.  
> I'll take a look at it to see if I can make it "better" before GA.  I don't 
> think my changes should affect vendors or the test suites, so if it turns out 
> to be that way i'll give it a shot.



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

Reply via email to