Click here to Skip to main content
15,899,025 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Can someone out there please tell me what is the difference between message passing and method invocation.
Posted
Comments
Sergey Alexandrovich Kryukov 25-Sep-12 15:19pm    
This is totally incorrect question, as most questions in the form "what is the difference between {0} and {1}". Isn't this obvious?
If you still did not get it, tell us the difference between apple and Apple.
--SA
Trilok Arora 1-Oct-12 16:33pm    
Hi Sergey,

Can you please explain why my answer was downvoted. It was not an incorrect answer.

The question asked here might be very basic but downvoting a CORRECT answer to a question needs an explaination.

Thanks,
Sergey Alexandrovich Kryukov 1-Oct-12 16:59pm    
I answered, please see below.
--SA

 
Share this answer
 
Method Invocation is when you give a call to method
Message Passing is passing objects as parameters (to a method)

C#
class A
{
    public void Method(Object obj)
    {
        // Method does somthing
    }
}

class B
{
    Object obj1 = new Object();

    A a = new A();
    a.Method1(obj1);
}


In the above example a.Method1() is Method invocation
passing parameter (obj1) to Method1 is message passing
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 1-Oct-12 16:59pm    
Trilok,

The problem is that the question is totally incorrect, and you failed to indicate it, hence all further problems. What you show here is the parameter passing, and not "message passing", at least in .NET. Yes, in some contexts, the calls similar to what you show are called "sending messages", but the whole invocation is considered a message, not just the parameter. Basically, what we call a call of a method, could be called "sending a message", pretty much like in Smalltalk. In some other contexts, the parameter can represent a message. So, I don't really see anything "CORRECT" in this answer.

If you want to see how some correct answers look, just look around this forum. There are very many of them.

I'm really sorry that my feedback is that negative, but the truth is the most important thing, isn't it? Besides, when somebody explain me my mistakes, I try to fix them and improve myself. I hope I'm helping you to do the same... :-)

Cheers,
--SA
Trilok Arora 2-Oct-12 14:05pm    
Well, If I just read the reply you posted to me, then it is a very valid question asked initially.


You are just contradicting yourself... SORRY!!!
Sergey Alexandrovich Kryukov 2-Oct-12 14:10pm    
I cannot see the contradiction, excuse me, what is that?
--SA
Trilok Arora 2-Oct-12 14:24pm    
Read the line posted by you


' Basically, what we call a call of a method, could be called "sending a message" '


The above line contrdicts with you post earlier


' This is totally incorrect question, as most questions in the form "what is the difference between {0} and {1}". Isn't this obvious? '
Sergey Alexandrovich Kryukov 2-Oct-12 15:07pm    
Tho two my statements are unrelated, and I'm sure they are correct.
And yes, the question is totally incorrect. Do I have to explain it?

The notion of "difference" is just a figure of speech having no exact meaning. It makes sense in very casual conversation and only when the "compared" entities are of the same semantic layer and have a lot in common. For example, one can ask "what's the different between this and that engine" makes sense, but only most features are common. And "what is the difference between Titanic and navigation" makes no sense whatsoever; and this is how OP's question looks.

And you, too...
Unfortunately, not just your answer, but even more your objections demonstrates so considerable lack of judgement, that I don't know how to apply logical arguments in the dialog with you. So, I'm really sorry, but I don't want to loose your time for further discussion.

Thank you very much,
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900