Blog to discuss Midnight Coders products features, ideas and trends in development of Rich Internet Applications

Saturday, May 20, 2006

Flex data retrieval, paging

We made really good progress this week adding Data Management Services support to WebORB 2.1 for .NET. Below is a list of things we have working:

  • WebORB can read flex-data-services.xml and initialize all destinations from the file.
  • Flex clients can use the DataService component to retrieve data from a .NET-based data source
  • Paging support has two modes: 1) paged data can be retrieved from a cached data collection; 2) WebORB can go to the data access object (DAO) for every paging request
  • Data access objects are plain .NET objects. Data can be returned as DataSet, DataTable or IList
  • Using DataSet and DataTable can simplify the server-side code to the maximum. Here's an example of a method that retrieves data from a database:

    [Weborb.Data.ReturnType( "samples.contact.Contact" ) ]
    private
    DataSet loadContacts( string query )
    {
    DataSet dataset = new DataSet();
    string cnxString = "..................";
    OleDbDataAdapter aapter = new OleDbDataAdapter( query, cnxString );
    dataAdapter.Fill( dataset );
    return dataset;
    }

    Notice the ReturnType attribute. The attribute specifies the type of the data contained in the returned DataSet. Since the dataset contains raw data from the database, WebORB automatically serializes it as a collection of complex types. Each column becomes a property of the type in the collection and contains data from the corresponding row cell. The attribute provides information about the client-facing classname each complex type object is tagged with. In the example above, each row in the dataset will be serialized as a samples.contact.Contact object.

  • The client side code is identical as with FDS. Applications can create DataService component and use it to retrieve data from the server.

Friday, May 19, 2006

Flex Data Services and WebORB FAQ

Here's a set of questions from an email exchange I had with someone considering using WebORB to integrate Flex with .NET. The questions are great and some will find this information useful:

  1. Q: Would I still need to use FDS to use WebORB?
    A: No, WebORB provides a full implementation of the functionality available in FDS.

  2. Q: What kind of pricing structure will WebORB have?
    A: Great question! Currently we're still offering it for the same price as we always had ($799 or $899/CPU depending on the level of support). We will probably be introducing a new edition of WebORB (we're leaning towards WebORB Enterprise Edition) which will have all the Flex related functionality. The pricing of it will mostly depend on the pricing set for FDS.

  3. Q: Will WebORB data services integrate with the Cairngorm serviceLocator?
    A: Currently we're shooting to have a full support for FDS (RPC, Data Management and Messaging). Any integration with other products and frameworks will be done in a future release.

  4. Q: Will the Data Management Services include it's own, stand alone, security feature (users, roles, permissions) ?
    A: WebORB already has an excellent security model for securing exposed resources (.NET objects, web services, custom types). We will include support for security as FDS defines it as well.

  5. Q: Does WebORB support AMF?
    A: Yes, WebORB supports both AMF0 and AMF3

  6. Q: Will WebORB be able to return multi-table datasets to a Flex ArrayCollection?
    A: Yes. We already have it working and that functionality will be released in the next beta release (2.1 Beta 3)

  7. Q: How difficult is it to deploy WebORB?
    A: The process is very straightforward. All you do is copy the weborb assembly into the /bin folder of your asp.net application. Modify web.config to register an http handler and you are done.

  8. Q: Will the final release coincide with the Flex final release?
    A: That's the goal. We're working some enormous hours to get there sooner :)

Thursday, May 18, 2006

Flex Data Management Services in WebORB for .NET

We are making great progress adding support for Flex Data Management Services. The feature will be available in WebORB for .NET very soon. Data Management Services is a component of Flex Data Services - a powerful system enabling client-server connectivity and interaction for Flex applications.

The idea behind Data Management Services is quite simple - enable Flex applications retrieve data from .NET data sources and provide a mechanism for dynamic client-server data synchronization. Data may change in a data grid, and Flex will automatically update the backend. Flex Data Service already provides an implementation for Java. Our goal is to deliver the same functionality for .NET. You can read more about Flex Data Services here: http://labs.adobe.com/wiki/index.php/Flex_Enterprise_Services:overview

Thursday, May 04, 2006

New WebORB product page

We just updated the product page for WebORB. The new page should make it much easier to find information about the product. The layout should scale much better as we'll be adding a lot of new content covering Flex integration and new features in 2.1. Expect to see more articles, cool examples and additional FAQ entries.

The page is here: http://www.themidnightcoders.com/weborb/

Tuesday, May 02, 2006

WebORB 2.1 Beta 2 is available (AMF3, Flex Remoting, Auto-Update)

We are switching from private to public beta for WebORB 2.1 Beta2 for .NET. The Beta 2 is available for download from our website. 2.1 Beta 2 is most exciting release we have ever done. The release contains support for AMF3 and provides a complete implementation of the RPC functionality available in Flex Data Services (see the getting started article here). Additional features include auto-update, support for pre- and post RPC invocation events and major improvements in Message Server. The documentation for the new features (beyond what's in the two articles linked above) is non-existent and we're working to fill that void. The AMF3/Flex Remoting integration is very smooth and the articles should provide a good amount of info to get anyone started. If you have any questions about the features or how certain things work, feel free to post them to our interest group

Monday, May 01, 2006

.NET Attributes in WebORB 2.1

The 2.1 release will have a new extensible framework for applying method and class attributes to remotable .NET objects to control object activation, auto-update and potentially many other things. Historically, object activation in WebORB has been controlled by the client side through gateway URL - for example, flash remoting and AJAX client have to add "activation=session" to the WebORB URL in order to request session activation for the retrieved object. This approach has worked quite well, but conceptually, the decision (and any related configuration) on how to activate a particular object should be done on the server-side. The 2.1 release will take care of it through class attributes. So now a developer can place the [SessionActivation()] attribute into the class declaration and when an invocation request arrives for the class, WebORB will try to retrieve an instance from the current session.

Another example of using .NET attributes in WebORB is the AutoUpdate feature (I blogged about it in the previous post). We strived to make the feature as least intrusive as possible and the attributes appear to do the job quite well. For example, the method below retrieves a Car object through a method invocation.

[EnableAutoUpdate()]
public Car RentACar()
{
// ... method logic
}

The framework for applying method attributes in WebORB provides a way to handle pre- and post-invoke events. Suppose you created a .NET attribute and applied it to a method invoked from Flex, Flash or an AJAX client. If your attribute class implements the Weborb.IWebORBAttribute interface (see below), the product will execute the HandlePreInvoke method before the invocation of the method takes place and then will call the HandlePostInvoke method.

namespace Weborb
{
public interface IWebORBAttribute
{
void HandlePreInvoke( MethodInfo method,
object obj,
object[] arguments );

Hashtable HandlePostInvoke( MethodInfo method,
object obj,
object[] arguments,
object returnType );
}
}

The post-invoke method can return a map of key-value pairs (Hashtable). These values will be delivered to your client application along with the return type as metadata. I think this is quite a powerful framework. I am very curious to see how people will use it in their applications.