Jump to content
  • Advertisement
Sign in to follow this  
luasitdown

I often hear....

This topic is 4835 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
The "message" is the method call.

e.g.

An instance of ClassA would send a message to objectB
ClassA::DoSomething()
{
objectB->SomeMethod();
}


Direct invocation is most common, but once you have this seperation you can move the objects between processes or computers and use IPC and/or networking to "send the message". See DCOM, CCM3, or .Net Remoting (not sure what it's called in Java).

Share this post


Link to post
Share on other sites
I hate to say it, but I would probably either get a book on the subject of OOP (Object Oriented Programming) or take a class.

The basis of Object Oriented Programming is that an Object (or class) contains data and methods to access/modify the data in the class. Objects talk to each other by passing data/messages to each other. The kind of data/message being passed is really dependant on the specific situation.

Lets suppose I have two objects, a Lightbulb and Switch. They are somewhat like the following:

Lightbulb:
----------
State: On or Off
----------
+SetState(State)


Switch
---------
SwitchState: Up or Down
---------
+TurnOnLight(LightBulb)
+TurnOffLight(LightBulb)


Now, when I want to turn on the light, I would do something like:
Switch.TurnOnLight(DeskLamp)

The code behind this would be something like:
Switch::TurnOnLight(LightBulb)
{
LightBulb.SetState(On)
}

The Switch object basically sends a message to the LightBulb object, to tell it to change it's state from Off to On. I really would recommend getting a book on the subject, or even browsing a basic C++/Java/Object Oriented Programming book to get a rough idea of how things work.

Share this post


Link to post
Share on other sites
Thanks for you two.

There some dependency relation bewteen Modules(class).

So I think the relation are base of message.

i.e. if 2 object (class) have not dependency ,and message cannot be produced.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!