Browse OOP reference
Relationships and dispatch

What is message passing?

On this page

A sender asks a receiver to perform an operation and leaves the receiver to interpret the request. A Smalltalk message can be delivered within one process. A distributed actor message may cross a network. Delivery, ordering and failure guarantees must be specified separately for the latter.

Worked example

Python
from queue import Queue

mailbox = Queue()
mailbox.put(("resize", 256))
operation, width = mailbox.get()
assert operation == "resize" and width == 256

Python tutorial on classes

Explore class relationships in the OOP Playground

What are abstract classes?What is polymorphism?What is delegation?

All OOP questions

Search ObjectFAQ