Checking contextual integrity
Cantor, Scott
cantor.2 at osu.edu
Thu May 23 16:34:43 EDT 2013
On 5/23/13 2:32 PM, "Rod Widdowson" <rdw at steadingsoftware.com> wrote:
>
>But I was wondering whether there is analogue here to the Action situation
>and we can demand that (in the usual flow) before the attribute filtering
>occurs, the context is inspected and the ability to find the
>AttributeRecipientContext confirmed.
I would except the filtering action to do this, yes.
>That way the filtering code can just
>locate the AttributeRecipientContext and its contents without fear of an
>NPE
>and without throwing an exception. I suppose in this case it is "one step
>out" and what I am proposing is an Action to check the context. Perhaps
>even it is the same as the Action which populates it?
There has to be an action that actually runs the filtering step, that's
what I would expect is checking this (if it is in fact a required context
in every possible scenario).
But I think it's also the case that in an extensible system, there's no
way to guarantee that every extension will be able to assume that it has
what it needs. But they probably should fail "safe" in that case.
>Or do I just learn to love living with ThrowingPredicates?
I would tend away from that model, as I think I've said in other cases. I
don't like "true/false/throw" interfaces.
-- Scott
More information about the dev
mailing list