WebORB Beta2 update
Lots of progress with Beta2. We fixed the Rich Client System to work with Safari 2.0. There are bug fixes in the library to support proper serialization of the JavaScript Date object and arrays.
There is an important change in the .NET edition of WebORB coming in Beta2. We changed how .NET complex types get serialized. Previously WebORB serialized both private and public fields of a .NET object. The approach was acceptable, but caused inconvenience if a class also declares properties to get/set field values. Indeed, the approach resulted in two different representations of the same class on both client and server sides. The Beta2 release corrects that problem. The new approach will serialize only public fields and properties. To support existing applications running with FlashORB, we added a configuration parameter that will turn on serialization of private fields.
Here's an example of a C# class declaring a property:
namespace Weborb.ExampleBelow is an example of how the property from the Person class shown above can be used in a JavaScript or a Flash Remoting application:
{
public class Person
{
private string _name;
public string Name
{
set
{
name = value;
}
get
{
return _name;
}
}
}
public class PersonFactory
{
public Person getPerson( string someName )
{
Person p = new Person();
p.Name = someName;
return p;
}
}
}
JavaScript/AJAX:
var className = "Weborb.Example.PersonFactory";Flash Remoting:
var proxy = webORB.bind( className, "weborb.aspx" );
var personObj = proxy.getPerson( "James Bond" );
alert( persobObj.Name );
var webORBURL = http://host/weborb.aspx;
var proxy = new Service( webORBURL, null,
"Weborb.Example.PersonFactory",
null, null);
var callObj:PendingCall = proxy.getPerson( "James Bond" );
callObj.responder = new RelayResponder( this,
"gotPerson", "gotFailure" );
function gotPerson( resultEventObj:ResultEvent )
{
var personObj = resultEventObj.result;
trace( personObj.Name );
}







0 Comments:
Post a Comment
<< Home