Fog Creek Software
Discussion Board

Message Based Programming

Does anyone know anything about message based programming? Are there message based programming languages? What are the pros and cons compared with oop and other methods? Under what circumstances would message based programming be the right tool for the job?

I've been reading come of the GotDotNet blogs and they seem to push message based programming using xml as an interesting alternative approach to programming (alternative to oop). However I can't find any resources on the net that go into details.

Saturday, September 27, 2003

I thought message based programming was

I once read that Alan Kay while working on OOP at the Palo Alto Research Center in the 70's, explained the notion of objects exchanging messages ...

Saturday, September 27, 2003

Do you mean messaging? Look into TIBCO rendez-vous, JMS,

Or do you mean realtime OS messaging, then maybe may help.

Tom Vu
Saturday, September 27, 2003

In OOP, by "messages", in 99% of the time they mean just method calls.

OOP message == OOP method call

So, it's just another term.

Gigi Duru
Saturday, September 27, 2003

The only other method I know of is distributed programming. In distributed programming a job is really a series of dicrete steps. It is massively helpful if at any given moment any one of these series of step can step out of a busy processor and get the job done on a less busy processor. To do that it has to take the state of where it's at, package it (serialize it), go on a trip to the other processor, and resume it's job.

This is very difficult (currently) if it's job is to finish a HTTP document transfer.. because how would you temporarily interrupt a connection with the client half way through a document.. and resume the connection on another web server? These are some of the problems being tackled by most major commercial research groups.

Sometimes the management of job distribution is pretty trivial. You never dispatch a job to a busy server (among the cluster) and if the job never returns with the computational answer after a timeout you just send out the job again.

But all of this requires the mini-steps bring their job with them.. as they go from one step of the crunching to the next. And that's one way to do computation with messages.

Li-fan Chen
Saturday, September 27, 2003

In short, functions and objects are almost always never stateful. And you can reset an object's identity by having it load a serialized "object" that came in over the network. This is part of what Java's JINI  can do.

Li-fan Chen
Saturday, September 27, 2003

REBOL ( is billed as a "messaging language". I think they make their claim here due to the language being:

* highly network-centric - nearly all major standard protocols built cleanly into the 200KB lang core
* highly platform independent - 40+ platforms supported with _zero_ modifcations necessary to port your code
* highly readable - when properly written, the code reads a bit like a run-on sentence; if you want it even more readable you can write a domain-specific dialect that mimics your favorite pseudo-code or program design language

So, I think the idea they're going after is near-universal inter-machine communications, in a way that's readable for users/programmers. How much they deliver against that is a matter of opinion, but I can say that I find the language to be a spunky little champ regardless of the "messaging" label.

Check out their online cookbook for an example of 2 scripts talking to each other over TCP/IP in 25 lines (including a minimal GUI):

Most other languages are traditional fare with special libraries added on to generate XML/RPC/SOAP -- the language is divorced from the data, its format and the transport mechanism. REBOL's value prop is that it unifies code and data in a human-readable format across all networked platforms.

I'm Brian Fellow!
Saturday, September 27, 2003

Thanks for the responses so far.

I'm actually working on an distributed app that has several distinct workflow components and the workflow has to be configured by users. I think I vaguely remeber someone on this board talking about message based programming and they described it as having a post office type core with various independent modules that register their interest in a type of message. If that message arrives, then the post office forwards it to the interested modules.

Is that message based programming? It sounds interesting but I want to know more details.

Saturday, September 27, 2003

You are thinking of Blackboards. See p 165 of the pragmattic programmer. Examples they give are JavaSpaces and T Spaces.

Message based programming languages include SmallTalk and Objective C, but NOT C++.

Dennis Atkins
Saturday, September 27, 2003

Read up on Smalltalk !

James Ladd
Monday, September 29, 2003

AFAIK the main difference is where you store the state of an ongoing operation. In an RPC world state is kept on the server. I call you and some time in the future that call will return. In the OOP paradigm there is the added layer that says all the data you pass around are instances of classes that the whole processing infrastructure shares.
In message oriented architectures chuncks of data are passed around thruogh the distributed system. Each processing node does "something" and forwards, just depending on the state that is kept inside the message (or its wrapper). There is no "call" that needs to "return". Furthermore, there is no need to share a common semantics for the data through a common class system, and each node can map the data onto a class as it sees fit.
Message oriented systems are currently "en vogue" for large, high latency,  loosly coupled systems. Less binding is needed at both design time (different participants in the distributed system need less interaction agreements) and at runtime (system can change dramatically (in theory) during operation without interupting ongoing message processing).

Just me (Sir to you)
Monday, September 29, 2003

Do you mean something like this?

VoIP Monkey
Monday, September 29, 2003

Never heard of it but at first glance, no.
Seems to depend on shared class hierarchy between the nodes.
Think of it as the difference between an object persistance framework and a relational database. In the former each program employing persisted objects shares the classes to which the objets belong. With an RDB each program using the data can freely map data onto object class instances as it sees fit. You will not see the differences in small systems, but they become crucial when you move to large setups.

Just me (Sir to you)
Tuesday, September 30, 2003

Might seems like you're looking at something like Tibco, IBM Message Queue's or Microsofts' BizTalk server...?

Jilles Oldenbeuving
Tuesday, September 30, 2003

*  Recent Topics

*  Fog Creek Home