Need input for messaging?
Does message passing happen when a function is called without input?
i.e. from:object.toString();
Am I passing a message to an object?
This may differ between languages, but I am specifically referring to Java.
yes and no ... messaging is a model ... the only languages I personally know actually use this semantics of Smalltalk and Objective-C ... so yeah, in what object.method()
- that's the same number of messages as object.method(param_1,param_2,...param_n)
... and no, because it object.method(param_1,param_2,...param_n)
means:
- find the pointer to
method
inobject
- call this function passing
object
, as well asparam_1,...,param_n
to it
this absolutely captures the message passing semantics, but in the end it is a simple function call as you know it from procedural programming ... the number of parameters does not change the semantics of the model, nor the implementation ... the parameter list for the actual call just contains only object
.. ...
Yes. Passing messages refers to communication between objects, so any method call is a message passing.