4

So, there is an idea about multi-dimensional behaviour selectors that goes like follows (based on paper by R.Hirschfeld and P.Costanza : "Context oriented programming"):

  1. "selector": in 1D lookup we only have a name for our behaviour, which directly selects the function (i.e. in procedural languages, like C)
  2. "selector", "target": 2D lookup is classic OOP. Which method is being executed is also specific to the target, i.e. obj_instance.method(args) - obj_instance (the prototype of that, or, usually, the class) selects the appropriate method to execute based on the selector supplied by sender (method name)
  3. "selector", "target", "sender": This confuses me. Why would selected method be dependent on WHO asked to execute that method? How this can be useful, when the sender (the current method body) usually "knows" what method should be executed, as this is usually the programmers intent.
  4. "selector", "target", "sender", "context": this confuses me a lot more! I've seen the examples on this and I cannot comprehend why sender != context.

Could anyone elaborate on practical differences between 3 and 4 dimensional method lookup?

(asking this on CS exchange as this question is more research-related than a practical one)

artemonster
  • 379
  • 2
  • 9

0 Answers0