Lots of folks think of the
WS-Policy normal form as an OR of ANDs, as a Disjunctive Normal Form (DNF). While that's not a bad intuition, DNF and propositional logic isn't the actual logic for some specific reasons.
- The overall scenario is that a service wants to indicate alternatives, and the client should pick one of those alternatives.
- Boolean OR is satisfied if one or more of its terms are satisfied.
- Boolean exclusive OR (XOR) comes close, but it rarely matches people's intuitions.
- Complying with an alternative means doing the behavior associated with each assertion in an alternative, perhaps by calling a handler associated with the assertion.
- If a Boolean propositional variable is true, you could call the handler.
- If a Boolean propositional variable is false, not calling the handler wouldn't be sufficient.
- If a service offers a default alternative, that would be an alternative with no assertions.
- Boolean AND with no arguments would have to be true -- perhaps as defined by some instances of propositional logic, but often not what 50% of people would expect.
- If a service has no alternatives -- perhaps there is no intersection between its alternatives and a client's alternatives -- the set of policy alternatives would be empty.
- Boolean OR with no arguments would have to be false -- again often not what people would expect.
Instead of DNF, the WS-Policy normal form is a collection of collections: a collection of alternatives, each of which is a collection of assertions. Technically, they are multisets because they may have duplicates but the term collection has the appropriate semantic in a friendly package.
- The client selects one alternative (collection of assertions)
- The client does the behavior for each assertion in the alternative, e.g., calls the handler for each assertion.
- If there are no assertions in an alternative, the client doesn't have to do any behavior.
- If there are no alternatives, the client doesn't bother trying to talk to the service.
Since the logic is spelled out in Section 4 of WS-Policy, implementations won't be confused, and if you're the type of person interested in a deeper look, you won't be either :-)
Posted
Oct 14 2004, 10:14 PM
by
jeffrey-schlimmer