I'll let Mark Piller chime in on the data management aspect. They've
implemented a FDS equivalent that is very nifty.
On the workflow:
To pull data from a data store, the flow goes like this:
Flex -> WebORB -> .NET Library -> Data Store -> .NET Library -> WebORB
-> Flex
WebORB serializes the data/object and maps the remote class so that by
the time the data arrives in Flex you have immediate access to the
object elements. For example, if I want to return the contents of a data
table that I pulled in my .NET class, I return it as a List Of object.
WebORB serializes the data/objects in the list so that I can build an
ArrayCollection with the results in Flex.
Here is what it looks like practically:
I have a service manager class in Flex that has a public method:
public function getShippingRateTable():void {
serviceStore.source =
"Services.dao.ShippingRate.ShippingRateDAO";
serviceStore.addEventListener(FaultEvent.FAULT, faultHandler);
serviceStore.GetShippingRates.addEventListener(ResultEvent.RESULT,
getShippingRatesHandler);
serviceStore.GetShippingRates();
}
serviceStore is defined as a remote object:
private var serviceStore:RemoteObject = new
RemoteObject("GenericDestination");
The result handler looks as follows:
private function getShippingRatesHandler(event:ResultEvent):void {
if (event.result.length > 0) {
shippingRateTable = new ArrayCollection(event.result as
Array);
}
}
My service manager class is defined as a singleton so that my returned
data is immediately available throughout the application.
The mapped Flex class for the ArrayCollection items is:
import mx.collections.ArrayCollection;
[Bindable]
[RemoteClass(alias="Services.dao.ShippingRate.ShippingRate")]
public class ShippingRateVO
{
static private var _instance:ShippingRateVO;
public var ID:int;
public var pounds:Number;
public var rate:Number;
public function ShippingRateVO() {};
}
On the server side, my .NET class ShippingRateDAO has a public method:
Public Function GetShippingRates() As List(Of ShippingRate)
...
Return rates
End Function
In it I am connecting to my data store, pull the data from a data table
and compile my list of objects into a List(Of ShippingRate), which I
then return.
That's all there is to it! WebORB does the rest.
About the examples:
I just checked on them and they were working fine. You may want to get
with Mark Piller if you continue to run into issues.
Mark also has a Yahoo newsgroup for WebORB that you can post questions to.
Jurgen
Mark Ingram wrote:
What do you mean by full data management?
I can't seem to get any of the service examples to work, I just get a
dialog saying access denied and a load of other text.
So does your setup look something similar to:
Flex -> WebOrb -> .NET Library
?
Thanks,
Mark
------------------------------------------------------------------------
*From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED]
*On Behalf Of *Jurgen Beck
*Sent:* 21 May 2007 16:42
*To:* flexcoders@yahoogroups.com
*Subject:* Re: {Disarmed} RE: [flexcoders] Re: Am I using the right
technology?
I'm doing this right now with the Standard version of WebORB. I've
written my class library (wrapped in a DLL) that connects to the
database.
If you need full data management, you need to be looking at the
Professional version at minimum.
Check out the examples on the WebORB site. Go to:
http://www.themidnightcoders.net/flexexamples/weborbconsole.html
<http://www.themidnightcoders.net/flexexamples/weborbconsole.html>
This is the management console you get with WebORB. Select the
Services tab and look at the WebOrb Examples. Those are the services
that have been wrapped into class libraries. You can test drive them
and see the code you would need to implement them in Flex.
Jurgen
Mark Ingram wrote:
I should also state that the reason I want to use ASP.NET Web
Services or .NET Components is because I want to access a database
(the result of all collaborative work will be stored there).
Thanks,
Mark
------------------------------------------------------------------------
*From:* flexcoders@yahoogroups.com
[mailto:[EMAIL PROTECTED] *On Behalf Of *Mark Ingram
*Sent:* 21 May 2007 16:24
*To:* flexcoders@yahoogroups.com
*Subject:* RE: [flexcoders] Re: Am I using the right technology?
Hi Barrie, thanks for the response.
In terms of collaboration, anything will do. I tried a great example
using Flash Media Server 2, which was a chat client. Each client was
informed when a new client joined or typed a message. That's exactly
what I was looking for, as we created one the other week that was
based around polling. It worked, but it wasn't elegant.
The price tag on FMS seems steep too (not compared to FDS!). $4000
for 150 concurrent users? Or more users if you throttle their bandwidth.
The ideal solution for me would allow data-push and be able to
communicate with ASP.NET. I have looked at WebOrb, but again, $10,000
per CPU is a little high.
So here are the options as I see it:
Flex Data Services (LiveCycle Data Services): $20,000 per CPU
Midnight Coders Data Services: $10,000 per CPU
Flash Media Server: $4,000 per 150 users (unthrottled)
Polling WebServices: Free (plenty of development required though)
Another down side of FMS is that you can't develop in Flex Builder?
And from what I've seen it doesn't use ActionScript 3?
I feel awfully confused about all these similar products! Based on my
requirements, what would be the best option (see above)?
Thanks,
------------------------------------------------------------------------
*From:* flexcoders@yahoogroups.com
[mailto:[EMAIL PROTECTED] *On Behalf Of *barry.beattie
*Sent:* 21 May 2007 15:22
*To:* flexcoders@yahoogroups.com
*Subject:* [flexcoders] Re: Am I using the right technology?
Hang on a sec...
in giving Mark an answer, he's been landed with more jargon.
Mark, I'm nowhere near the expert that Tom or others here are on this
subject ...
... and there are some good blog posts around (and the Adobe site
itself) with decent detail on all of it ...
but... I work at a university and they're forever going on about
collaboration, whether it's research partners, academics or student
teams. I'm hunting for a project to put this into practice...
(in a nutshell) both remoting and webservices follow the typical
request/response. so any sync'ing of data needs polling so the clients
can find out if server has new changes.
but FlexDataServices (or LiveCycle DS now-a-days) has a handle back to
each client from the server so it can push events/notifications
telling the clients that the server's data has changed.
this gives a pretty powerful hub-type configuration where one client
commits updates on the server which can be sent back to all the other
clients in a heartbeat.
however, this is NOT peer-to-peer collaboration. the server is
definitely in the middle of it all, receiving and broadcasting to
subscribers. Which is OK if the data/documents/whatever is to be
persisted and managed on the server. Keep in mind, that sort of
technology isn't cheap - not compared to webservices...
I'm no expert on all of this and I've got my own issues trying to work
out how flex can do true peer-to-peer collaboration (no FDS). I'm also
unsure what the upgrade path will be with our FlashMediaServers (FMS)
while I wait for ColdFusion8 (and it's reported LCDS and FMS
integration).
but I do hope that's helped somewhat. Others can chime in with much
better replies. this is just something quick to help lift the fog.
what sort of collaboration do you need to do?