Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Developing U++ » U++ Developers corner » RMI
RMI [message #9215] Sun, 22 April 2007 09:21 Go to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
zsolt wrote on Sun, 22 April 2007 02:47


Quote:


and maybe another good point:
RMI for C++
http://rmi.sourceforge.net/pmwiki/pmwiki.php

The pages are password protected.
BTW I was thinking about something similar in UPP, because current callback system could be easily extended to work transparently on network.


So do I Smile But my thinking is rather based on Serialize...

The real question(s) is:

- can we do RMI without IDL?
- is it worth the trouble?
- does it need to look like method invokation or we can can sustain a little bit less transparent solution (like passing structures with Serialize member)?

Mirek

P.S.: As this is an interesting topic, I am moving a copy to technology lab, if you have any ideas, let us continue there...
Re: RMI [message #9220 is a reply to message #9215] Sun, 22 April 2007 10:17 Go to previous messageGo to next message
zsolt is currently offline  zsolt
Messages: 696
Registered: December 2005
Location: Budapest, Hungary
Contributor
I was thinking about creating some callback system for network communication, because in an event based system (GUI app) blocking calls are not the best.

BTW, RMI is used in Java internally only, because SOAP and XMLRPC is more portable and can be integrated easily in an enterprise environment.

So an ideal solution would be able to use a native C++ serialization or SOAP/XMLRPC as a transport layer as well.

[Updated on: Sun, 22 April 2007 10:18]

Report message to a moderator

Re: RMI [message #9222 is a reply to message #9220] Sun, 22 April 2007 11:01 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
zsolt wrote on Sun, 22 April 2007 04:17

I was thinking about creating some callback system for network communication, because in an event based system (GUI app) blocking calls are not the best.

BTW, RMI is used in Java internally only, because SOAP and XMLRPC is more portable and can be integrated easily in an enterprise environment.

So an ideal solution would be able to use a native C++ serialization or SOAP/XMLRPC as a transport layer as well.


Yes, but even for internal use, it is nice to have.

One thing that it could nicely address is clustering applications.

BTW, what you would relatively easy to achieve w.r.t. calls alone without any form of IDL:

struct MethodA {
    int a;
    Vector<String> b;

    void Serialize(Stream& s) { s % a % b; }
};

struct MethodB {
   ....
}

struct Server {
    void Do(MethodA& a);
    void Do(MethodB& b);
};

client:

Connection<Server> x;
....
MethodA a;
a.x = 123;
a.b.Add(123);
x.Do(a);


(Just to demostrate where I have ended the last time investigating this issue).

Mirek
Re: RMI [message #9223 is a reply to message #9222] Sun, 22 April 2007 12:25 Go to previous messageGo to next message
zsolt is currently offline  zsolt
Messages: 696
Registered: December 2005
Location: Budapest, Hungary
Contributor
class RemotelyCallableClass
{
public:
	RCallback1<int> doSomething;
};

class ClientSide()
{
	RClient<RemotelyCallableClass> client; //some setup needed
	void doSomethingRemotely()
	{
		client.doSomething(33);
	}
};

class ServerSide()
{
public:
	ServerSide()
	{

		server.doSomething <<= THISBACK(OnDoSomething);
		//some setup (IP, port)
	}
	RServer<RemotelyCallableClass> server; 
	void OnDoSomething(int v)
	{
		//some processing on server
	}
};

Of course this is an idea only Smile
RCallback arguments should implement a serializable interface if they are not basic types.
The return value could be handled as a callback on the client side with something like RGate<int, int>.
I don't prefer blocking calls.


Edit: I changed RClient to RServer on server side.

[Updated on: Sun, 22 April 2007 13:07]

Report message to a moderator

Re: RMI [message #9224 is a reply to message #9223] Sun, 22 April 2007 12:49 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Well, this is not a bad idea! If nothing else, it avoids the need to create those structs and to implement Serialize....

Mirek
Re: RMI [message #9225 is a reply to message #9220] Sun, 22 April 2007 13:07 Go to previous messageGo to next message
Ulti is currently offline  Ulti
Messages: 108
Registered: September 2006
Experienced Member
zsolt wrote on Sun, 22 April 2007 04:17

I was thinking about creating some callback system for network communication, because in an event based system (GUI app) blocking calls are not the best.

BTW, RMI is used in Java internally only, because SOAP and XMLRPC is more portable and can be integrated easily in an enterprise environment.

So an ideal solution would be able to use a native C++ serialization or SOAP/XMLRPC as a transport layer as well.

SOAP/XMLRPC is low efficiency.
for enterprise,it need much work to do:
such as corba(http://www.mico.org/) and ICE(www.zeroc.com)


better for internal first
thanks!
Re: RMI [message #9226 is a reply to message #9224] Sun, 22 April 2007 13:10 Go to previous messageGo to next message
zsolt is currently offline  zsolt
Messages: 696
Registered: December 2005
Location: Budapest, Hungary
Contributor
Yes Smile
But my main purpose was non blocking behaviour.
Re: RMI [message #9229 is a reply to message #9215] Sun, 22 April 2007 18:14 Go to previous messageGo to next message
zsolt is currently offline  zsolt
Messages: 696
Registered: December 2005
Location: Budapest, Hungary
Contributor
I was thinking a bit about it.
I think, that in some situations it could be useful, to have the same API for distributed and multi processed (multi thread/core) tasks.

[Updated on: Sun, 22 April 2007 18:14]

Report message to a moderator

Re: RMI [message #9235 is a reply to message #9220] Mon, 23 April 2007 08:04 Go to previous messageGo to next message
fallingdutch is currently offline  fallingdutch
Messages: 258
Registered: July 2006
Experienced Member
zsolt wrote on Sun, 22 April 2007 10:17

I was thinking about creating some callback system for network communication, because in an event based system (GUI app) blocking calls are not the best.


I am working on the same, but wanted to extend it to all Files/Devices.

On Linux: poll with read/write
on Windows ReadFile, WriteFile with OVERLAPPED and MsgWaitOnMultipleObjects

the Problem i have to solve at the moment is how to get the numbers of bytes in the buffer at a communication device on Windows. On Linux I use a nonblocking read, it returns the number of bytes read or gives the error wouldblock if nothing is in the buffer.

Do you have any Ideas?
Bas

[Updated on: Mon, 23 April 2007 08:04]

Report message to a moderator

Re: RMI [message #9237 is a reply to message #9235] Mon, 23 April 2007 09:25 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
fallingdutch wrote on Mon, 23 April 2007 02:04

zsolt wrote on Sun, 22 April 2007 10:17

I was thinking about creating some callback system for network communication, because in an event based system (GUI app) blocking calls are not the best.


I am working on the same, but wanted to extend it to all Files/Devices.



Are you sure this is the same problem? In fact, I think callback system for network communication would be a great implementation tool for RMI or for something built on RMI, but it is not RMI itself Smile

Mirek
Re: RMI [message #9238 is a reply to message #9237] Mon, 23 April 2007 10:36 Go to previous messageGo to next message
Ulti is currently offline  Ulti
Messages: 108
Registered: September 2006
Experienced Member
personally like ICE very much(though ICE is not RMI,it's middleware),but it's GPLed.if U++ support RMI,then php will be easily supported(via writing PHP extension)

[Updated on: Mon, 23 April 2007 10:38]

Report message to a moderator

Re: RMI [message #13634 is a reply to message #9215] Fri, 18 January 2008 09:38 Go to previous messageGo to next message
Shire is currently offline  Shire
Messages: 41
Registered: September 2006
Location: Russia, Yamal peninsula
Member
Quote:


personally like ICE very much(though ICE is not RMI,it's middleware),but it's GPLed.



I prefer ICE too, but it is based on STL. UPP can have its own implementation of network communication protocol.
IMHO, communication will be better, if it is based on queries, rather than RPC. Query is simple structure, consist of base types. Queries is better for asynchronous work, multi parameter passing and grouping multiple in one network packet. Handling queries can be easily chained. Query can build by accessors and query builders. Binding to other languages (USC, for example) also can be simple.
To do this, these components needed:

* serialization for marshalling queries
* platform-independent query description language (can be done by macros)
* platform-independent binary protocol description (IMHO, the most difficult part)
* local (per application) or/and global components registry (for dynamic creation)
Re: RMI [message #13635 is a reply to message #13634] Fri, 18 January 2008 10:13 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Shire wrote on Fri, 18 January 2008 03:38

Quote:


personally like ICE very much(though ICE is not RMI,it's middleware),but it's GPLed.



I prefer ICE too, but it is based on STL. UPP can have its own implementation of network communication protocol.
IMHO, communication will be better, if it is based on queries, rather than RPC. Query is simple structure, consist of base types. Queries is better for asynchronous work, multi parameter passing and grouping multiple in one network packet. Handling queries can be easily chained. Query can build by accessors and query builders. Binding to other languages (USC, for example) also can be simple.
To do this, these components needed:

* serialization for marshalling queries
* platform-independent query description language (can be done by macros)
* platform-independent binary protocol description (IMHO, the most difficult part)
* local (per application) or/and global components registry (for dynamic creation)


Interestingly, your new response to this old thread came at the moment I am about to start implementing some SOAP for/in U++ Smile

Mirek
Re: RMI [message #13639 is a reply to message #9215] Fri, 18 January 2008 12:58 Go to previous message
Shire is currently offline  Shire
Messages: 41
Registered: September 2006
Location: Russia, Yamal peninsula
Member
Well, funny coincidence Smile
SOAP support will be good.
Previous Topic: DrawAggData.cpp and internal AggDrawData formats
Next Topic: New hash folding function...
Goto Forum:
  


Current Time: Fri Apr 19 20:22:58 CEST 2024

Total time taken to generate the page: 0.04554 seconds