Raymond Feng wrote:
+1 on the proposal.

The interceptor could just return the flag based on its capability without asking the next one. And the runtime can query it from the head in the invocation chain and stop when it gets a true.


It could, but that would be making an assumption on the behavior of the interceptor - assuming that it always calls next.invoke(message).

Here's an example showing that:

Message invoke(Message message) {
  // example implementation
  if (someCondition) {
    return next.invoke(message);
  } else {
    // do something else
    return message;
  }
}

Imagining that the next interceptor always returns false, hardwired invocation chain walking logic will return false (incorrect) instead of true.

Without hardwired logic in the core runtime, the interceptor can simply implement allowsPassByReference() like this:

boolean allowsPassByReference() {
  // example implementation
  if (someCondition) {
    return next.allowsPassByReference();
  } else {
    return true;
  }
}

and return the correct value.

In general, I think that more control and hardwired rules in the core runtime (leaving less flexibility to the extensions) eventually cause further complications... when the hardwired rules get in the way and we then have to pile yet another mechanism or rule on top to work around them :)
--
Jean-Sebastien

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to