Views
Replies
Total Likes
Hi. As far as I know both DataService and RemoteObject are asynchronous APIs. If you call a DataService method such as fill() or call a method on your RemoteObject, code in your Flex application will continue to execute and the result from the RemoteObject or DataService request will be received asynchrounously. I don't believe there is any way currently to make synchronous or blocking calls in Flex because of the Flash Player's execution model.
How are you planning on using the DataService and RemoteObject in your application? Is it to do something like populate a DataGrid? Do you plan on updating the data retrieved from the DataService or RemoteObject such as adding, updating or deleting records?
The DataService API is much more powerful than the RemoteObject API, in that if you bind an ArrayCollection that is populated from a DataService to your DataGrid, when you update data in the DataGrid, the data on the server is updated and all other clients that have the same view of the data will also get the updates. You don't currently get this functionality with RemoteObjects.
My point here is that if you wanted to write an abstract service that supports both DataService and RemoteObject and you need to be able to add, update or delete records you are going to need to write a lot of custom code to listen for collection change events when data on the client is modified and translate these change events into RemoteObject requests. Even if you did do that, other clients would not get these updates.
If all you want to do is something simple like populate a DataGrid with data from the DataService or RemoteObject, then sure, writing an abstraction layer on the client that supports both of these wouldn't be hard.
-Alex
Views
Replies
Total Likes