A mind-bending experience
Back in November 2010 of last year, I remember that a stranger walked up to me at the Green Lion Inn Bar after the Oredev conference and told me that my notion of aspects, and of object-oriented design was actually a limited version of some of the message passing capabilities of some old language named Smalltalk.
He asked me to imagine for a moment that everything in OOD is a message. In original OO terminology, he said, there were methods, and messages. Whenever you call a method (in today’s terminology), what you are implicitly doing is sending a message to an object telling it to execute the code associated with that message (the method).
For me, the concept of methods executing as a result of implicitly sent messages seemed fairly straightforward, but the discussion took an interesting turn.
He said, “Imagine that these messages can be sent from anywhere. They can be running within the same process, running on your machine, or they can even be coming from a machine that is located halfway across the world.”
The concept of Remote Procedure Calls wasn’t anything new—but the next thing he said piqued my interest.
“If every method is merely a message to be sent, then any method call can be remoted [if you rewrite it with IL].”
In effect, what Greg was proposing was to create a messaging system that was so granular that one could transparently take any method call on any given machine and have it execute on another machine or process without modifying the original source code. In theory, one could use such a system to split a single process so that it runs parallel on multiple machines, all without modifying the original source code.
In other words, he was proposing automatic parallelization of any application using AOP, and IL rewriting.
Needless to say, my jaw hit the floor, and I was left speechless.