View Full Version : How to use JAVA Objects with laszlo ?
alainvd
01-11-2005, 11:23 PM
Hello,
It looks stupid, but I can't find any information anywhere.
I call rpc to my java apps and I received a custom object. What can I do with it ? How can I handle it ? Is it possible to change some data and then send it back to my java application ?
Thanks in advance for the explanations :)
zhangling
01-19-2005, 12:04 AM
Here is my understanding.
We can get a object from JavaRPC. In fact, in my case, I only use return a plain string. Even if you can get an object, how about it's methods? Laszlo does not have a real binary RPC solution, which should be Corba's job. So the only way is to serialize the object to strings and re-orgazine them to object on the server side.
Am i right?
alainvd
01-19-2005, 12:13 AM
That's what I fear too. It involves some scripting on the server side which is really a pain imho.
bloch
01-19-2005, 08:03 PM
You do get access to your object's public methods :-) No extra server-side code is required.
You can bind methods and parameters to the methods calls via the <remotecall> tag or you can call them directly in script via the proxy slot of your rpc object.
It's pretty decent actually.
To be clear, you get a _proxy_ to the object itself rather than a "copy of the object". You get read access to members and you can invoke methods via the proxy. If you want to get your object and change a few things, the simplest thing to do might be to have a single method that allows you to change all these things at once. Or you can have a setter for each thing.
But... in the Laszlo declarative programming idiom it's often easier/simpler (less code) if you simply bind pieces of your ui using remotecall so that when the ui changes, the new values are pushed to the server automatigically.
See http://www.laszlosystems.com/lps-2.2/docs/reference/javarpc.html
and
http://www.laszlosystems.com/lps-2.2/docs/guide/rpc-javarpc.html
Feel free to ask more questions if the docs don't cut it.
alainvd
01-20-2005, 02:00 AM
Thanks.
I have no problem using Java RPC to call the methods on objects. My concern was more about the handling of the data in Laszlo.
If I receive one JAVA Object from my RPC Call, what am I supposed to do with it ?
pablo
01-20-2005, 11:11 AM
If a java rpc method returns an object, only public members are accessible. You can't pass that object back to the server. There were thoughts of returning complete java rpc objects down to the client, but server-side object reference issues and time constraints prevented this implementation.
pablo
vBulletin® v3.8.4, Copyright ©2000-2012, Jelsoft Enterprises Ltd.