www.digitalmars.com         C & C++   DMDScript  

D - Remote objects?

reply julianaubourg hotmail.com writes:
Hi all,

I'm pretty new to D and I admit I'm quite impressed by the way it's designed so

I'm thinking about developping a network oriented app and I'd like to go for a
java-like Remote interface system. Interestingly enough, with the in/out
parameter specifiers and the interface system, there is no need for a
third-party interface language like IDL in D. If you limit this system to
interfaces where only basic types are used as parameters or returned values,
there's no need for serialization (it's limited, but is still usable... exactly
like IDL is AFAIK).
If we don't go for a naming service right from the beginning, we could come up
with a pretty simple package:

template (InterfaceClass) {

void put(InterfaceClass * remoteObject, char [] address);
InterfaceClass * get(char [] address);

However, this raises some problems:
1) I dunno what the RTTI in D is capable of. Any doc?
2) "get" would need to:
a) check if the remote object at "address" defines all the methods defined by
b) create a local implementation of "InterfaceClass" that contains all the
network stuff. One could think of something like a method call overloading

I guess most of the problems could be solved within the compiler (why not allow
for cast on Remote objects that would control if the destination object
implements all the methods needed and get rid of the pointers?). This would
prevent from using an IDL-like compiler (or rmic or alike) which given the D
syntax would be redundant.
Maybe D could come with an integrated ORB (like TAO for instance) and provide
naming services and all sort of fancy stuff.

I'm in a prospective process right now, so this post is for discussion purpose
and to know what the D team has in mind when it comes to distributed object
Another network related question is also about a strong url support so that
streams could be opened remotely without having to dig into the socket API.

Thanks for reading this and thanks for your work on D,

-- Julian
Mar 10 2003
parent reply "Ken Carpenter" <kencr shaw.ca> writes:
<julianaubourg hotmail.com> wrote in message
news:b4idga$2fq$1 digitaldaemon.com...
 Maybe D could come with an integrated ORB (like TAO for instance) and
 naming services and all sort of fancy stuff.
It might be worth considering writing a language mapping for the Ice libraries instead. Ice is a GPL'd OO middleware product similar in concept to CORBA. In fact, it was created by a team of CORBA guys including Michi Henning, who wrote "Advanced CORBA Programming with C++". Basically, you get an OO RPC mechanism that provides: - automatic serialization of complex object structures - XML-based or binary-based object persistence - built in SSL and compression support - firewall traversal features It also provides a bunch of features for large server farms, including automatic service deployment, load balancing, and publish/subscribe messaging. It's pretty cool. http://www.zeroc.com/ice.html If you've ever had to write any CORBA code and have found yourself disgusted with its shameful and needless complexities, take a look at Ice. It's C++ mapping is much nicer. We now return you to your regularly scheduled programming. Ken Carpenter
Mar 11 2003
parent J.Aubourg <J.Aubourg_member pathlink.com> writes:
Yes, ICE seems very interesting. However, I dunno if using a purely GPLed (and
not LGPLed) library in the implementation of the language is a good idea. It
would most likely forbid the creation of proprietary applications in D.
Mar 13 2003