SimpleORB
From Wikipedia, the free encyclopedia
SimpleORB is a light-weight Object Request Broker, based on a serialization library which can transmit arbitrary object graphs over the network. There is no interface definition language, but readObject()
and writeObject()
methods, which must be defined for all data classes that are to be transmitted. SimpleORB is not CORBA-compliant, which makes it quite small.
The ORB is available for Java, C#, C++ and VisualWorks Smalltalk. Servers and clients can be written in any of these four languages and will virtually effortless interoperate.
Contents |
[edit] Comparison with other ORB technologies
SimpleORB is
- cross-platform, cross language capable (like CORBA, unlike DCOM and JRMP)
- simple (no IDL, no IDL compiler runs, unlike CORBA, DCOM)
- small (no stubs, no skeletons, small runtime lib (76kBytes), unlike CORBA, DCOM)
- fast (ten times faster than SOAP, five times faster than SUN's java IDL)
[edit] Performance
Performance of SimpleORB is highly dependent on hardware, operating system and programming language. The following figures should be used with caution, as operating system configurations might make a big difference. Performance is always measured with the client running on the same machine as the server.
CPU | Operating System | Hardware Vendor | Programming Language | Local Calls/Second |
---|---|---|---|---|
Athlon 1,8 GHz | Windows/XP | Noname/AMD | Java | 1600 |
Athlon 1,8 GHz | Windows/XP | Noname/AMD | VisualWorks Smalltalk | 800 |
4 x PowerPC G5 | Linux | IBM | C++ | 12500 |
PowerPC MacMini | Mac OS X | Apple | Java | 600 |
PowerPC MacMini | Mac OS X | Apple | C++ | 600 |
[edit] Size
SimpleORB applications are quite compact (SimpleORB itself is just 76kBytes (compressed) for all languages together), because there is no overhead in the form of stubs and proxies. This also assures short develop/compile/debug cycles.
[edit] Sample Application
The following is a client-server HelloWorld application implemented with SimpleORB:
The Server:
It consists of the remote method, which must take a single FGSerializeable as an argument and return a single FGSerializable object.
package org.fg; import org.fg.sORB.*; import org.fg.*; public class HelloWorld{ public FGSerializeable sayHello(FGSerializeable arg){ System.out.println("Hello World from "+((HelloArgument)arg).name); return new HelloResponse(); } }
The Argument
The argument class must be of type FGSerializeable, which means it has to define the methods readObject() and writeObject(). In this case, only the name String is serialized.
package org.fg; import org.fg.*; public class HelloArgument implements FGSerializeable{ public String name; public void readObject(Deserializer d) throws SerializationException { name=d.readString(); } public void writeObject(Serializer s) throws SerializationException { s.writeString(name); } }
The response
The response does not contain any "payload", so the serialization methods are empty:
package org.fg; import org.fg.*; public class HelloResponse implements FGSerializeable{ public void readObject(Deserializer d) throws SerializationException {} public void writeObject(Serializer s) throws SerializationException {} }
The Client:
package org.fg; import org.fg.sORB.*; import java.util.*; import org.fg.*; public class HelloWorldClient{ public static void main(String[] argv){ try{ ORBClient client=new ORBClient("localhost",1444); ORBObject remoteObject=client.createRemoteObject("org.fg.HelloWorld"); HelloArgument argument=new HelloArgument(); argument.name="Goofy"; remoteObject.invoke("sayHello",argument);//do the remote call remoteObject.release();//release server object client.disConnect();//disconnect all TCP connections } catch(Exception e){ System.out.println("caught Exception:"+e); e.printStackTrace(); } } }
[edit] Copyright
SimpleORB is distributed under the LGPL.
[edit] Author
SimpleORB was written by Frank Gerlach, who can be contacted at frankgerlach@gmail.com.
[edit] External links
SimpleORB is currently not available on publicly accessible servers. Contact Frank Gerlach (frankgerlach@gmail.com) for a free copy.