« Return to Thread: Serialization of DataTable
by mark.jonkman
::
Rate this Message:
Reply (Restricted by the Administrator) | Reply to Author | View in Thread
Hi
Sorry for the delay.
When serializing a query from CF the default return type is an
ArrayCollection of untyped objects. In Java, I’m going to have to be a
tad less “certain” but when I last worked with a Java developer it
was returning an ArrayCollection of untyped objects. I’m almost dead
certain that all my research at the time pointed to ArrayCollection as the default
“replacement” to the old Flash Remoting RecordSet object relative
to Flex 2. In CF I discovered last week that the only way to force CF to return
an ArrayCollection of typed objects was to add __type__ as a column in the
recordset with that column containing a string of the object type in
Flex. I personally haven’t tested the theory yet.
Any, that aside, are you saying that it currently works to add
the same attribute handling to class members (properties and fields)? Or that
you would have to check in a change that would allow it? I was trying the
attribute last week and it was throwing an error in Visual Studio. Perhaps I
had an outdated build.
I’m not in an instantaneous hurry, if you’re planning
a release in the next week or so I can wait. Right now I’m just
prototyping client side code and doing mockups of the GUI before I start
spending time connecting to the backend.
Thanks Zoli – I’m really enjoying working with
FlourineFX.
Sincerely
Mark R. Jonkman
From:
fluorine-bounces@...
[mailto:fluorine-bounces@...] On Behalf Of Support
Sent: Thursday, March 26, 2009 8:34 PM
To: 'Fluorine Mailing List'
Subject: Re: [Fluorine] Serialization of DataTable
Hi Mark,
Yes, the same attribute handling can be added to class members
(properties and fields).
Related to your question "why aren't automatically turned into
ArrayCollection"...did you check that CF and Java do this automatically?
For example this conversion table http://livedocs.adobe.com/flex/201/html/ent_services_config_097_08.html#270405 does
not even mention what rules the Java RowSet mapping follows.
If you need it urgently then I will commit the required changes to
the SVN (a new release is planned soon)
Zoli
From:
fluorine-bounces@... [mailto:fluorine-bounces@...]
On Behalf Of mark.jonkman@...
Sent: Thursday, March 26, 2009 7:56 PM
To: Flourine Mailing List
Subject: [Fluorine] Serialization of DataTable
Hi
Is there anyway to change the default handling of how DataTables are serialized
in FlourineFX.
The [DataTableType("...")] only seems to work with methods and I have
classes that I need to send to Flex that have complex data in them including
several that have DataTables stored in publicly accessible properties. Thus far
my workaround was to write a method that simply serializes a DataTable into a
ArrayCollection of Hashtable's so instead of storing a DataTable in the class
property I store the ArrayCollection. I've never quite grasped the concept of
why all DataTables aren't automatically turned into ArrayCollection of generic
objects when passed back from Flourine. In my case, I have to write an Flex app
that needs to be completely agnostic to the backend server. We have to create
.NET version, ColdFusion and perhaps Java versions of the backend to satisfy
the requirements. Thus I need to standardize how DataTables are sent back to
match how CF or Java would.
A sample case I face would be:
on Facade calling a method called login(username, password) returning an
instance of User if login successful. User contains information about the user,
the basics stuff as well as information about what tasks they need to perform
today and what parts of the system they have access to. In theory I could call
3 times to the server to do this, but why call the server needlessly when
one call would suffice. In an ideal world the concept of the
[DataTableType("...")] would apply to public properties as well as
methods.
I will admit I'm not a heavy hitter in terms of C# programming so before I
start tearing into the source code of FlourineFx or pulling my hair completely
out I thought I'd ask.
Sincerely
Mark R. Jonkman
« Return to Thread: Serialization of DataTable
| Free embeddable forum powered by Nabble | Forum Help |