Inside the World Wide Virtual Machine
As I mentioned in my previous blog, the World WideVirtual Machine is a very exciting free space for the development of robust scalable fault-tolerant distributed applications. The cajo project is a small free framework defined to simply and easily realize this vision. Its reception by the java.net community has been both strong and positive. So in response to this, I thought it would be worthwhile take a little time to explain the philosophical concepts of the WWVM.
For the developers of the World Wide Virtual Machine, there is a fundamental viewpoint, which can be stated as follows:
The network is a vast collection of objects, ready to be used to create other objects.
If you stop to think about it, this is not too different from what exists in a typical single Virtual Machine design: There is the runtime library, and a collection of other local objects, both used to create applications. In fact, any application can be defined as follows:
An application is an object, which itself is composed of, a collection of objects.
As you can see, the WWVM is not a really large conceptual jump, especially considering all the exciting possibilities it enables. So let's take a look at some more WWVM fundamentals.
It has been stated that an application is a collection of objects, and it has also been stated that the network is a collection of objects; so necessarily the WWVM must have a very clear definition of what an object is:
- An object has 1 or more public methods,
- An object has 0 or more non-public member objects,
- An object's public methods interact with 0 or more private member objects, with 0 or more argument objects, to return 0 or 1 result object; or to throw an Exception.
In a single-VM design, there is only one general category of object: local ones. These run in the address space of the host VM. However, in the WWVM there are three fundamental object categories:
- Local Objects: existing in the local VM address space.
- Remote Objects: existing in the address space of a remote VM, linked by the network.
- Proxy Objects: existing in the local VM address space on behalf of a remote VM, and may (or may not) be communicating with it.
Each of these objects, being fundamentally different, are obtained in different ways:
- Local objects are instantiated, either via a new or newInstance method invocation; or are deserialized from an ObjectInputStream.
- Proxy objects are obtained via a remote object method result, or exception.
- Remote objects are obtained via a request from a remote VM; or via a remote VM broadcast. (sometimes called listening to radio station WWVM :-)
While each category of object is used identically syntactically; the objects themselves exhibit fundamental properties, based on their category:
- A local object can be passed to a remote object, only if allowed by both sides, where it will exist there, as a proxy.
- A remote object reference can be freely passed between all objects and Virtual Machines.
- A proxy is unique to the runtime in which it exists, and cannot be passed to another VM.
Objects are passed to other objects, either as method arguments, method returns, or in method exceptions. A proxy may even provide a distributed user interface, by instantiating a Window, as needed, at its hosting VM.
In the WWVM there are no primitive types per se; such as char and int. These are considered purely special case optimizations, of value solely within a local Virtual Machine. Also there is no inheritence of network objects. The WWVM focus is solely on the use of objects, by objects. Distributed objects are used solely via their public method interface.
The following security philosophy is inherent in the WWVM:
It is expected that all proxy objects will be hosted in a JNLP/Applet-type sandbox.
This makes the development and use of the WWVM no more risky than using ordinary applets, or WebStart applications; in fact, proxy codebases are typically unsigned. In other words; using the WWVM is safe.
At the cajo project, we are delighted to welcome new developers into the WWVM. It is a fascinating free environment that will only grow richer with greater participation. We welcome you to come look inside. It really does create some very exciting opportunities for an entirely new type of Internet.
(And of course, it also works equally well for the development of powerful distributed LAN applications :-)