« Return to Thread: Interface mapping
by Support-179
::
Rate this Message:
Reply (Restricted by the Administrator) | Reply to Author | View in Thread
Hi Sam,Actually attributes sound "safer".I do not expect a big success for developers configuring typenames like: class="System.Collections.Generic.List`1[ServiceLibrary.SomeVO]" :)Will consider this requestZoli
From: fluorine-bounces@... [mailto:fluorine-bounces@...] On Behalf Of Samuel Neff
Sent: Friday, May 02, 2008 4:24 PM
To: Fluorine Mailing List
Subject: Re: [Fluorine] Interface mappingIt would be nice though if Fluorine provided some methodology for doing this. Two options would be to provide a mapping of interfaces to concrete classes within a config, like:
<interfaceMap>
<map interface="IList<T>" class="List<T>" />
<map interface="IDictionary<TKey, TValue>" class="Dictionary<TKey, TValue>" />
</interfaceMap>
or use an attribute on the individual properties (less desirable due to repetition)
[InstantiateInterfaceAs(typeof(List<DataItem>))]
public IList<DataItem> Data { get; set; }
We use concrete List<> collections in all of our data object but have definitely run into situations where it would have been preferrable to use IList<T> even if upon receive Fluorine always created them as List<T>.
Thanks,
Sam
On Fri, May 2, 2008 at 7:48 AM, Support <support@...> wrote:
Hi Daniel,Not in both ways:It is safe to have a method (or VO property) that returns an interface. The AMF encoder will see the underlying type so it will be sent correctly to Flex.But when the gateway receives an object from Flex and has to convert to a .NET type it is just not enough to have the (.NET) interface type. FluorineFx has to instantiate an object and from the interface no one can tell what object to create.(And this is not even a Flex remoting specific request, it would apply to any RPC)Zoli
--
-----------------------------------------------------------------
We're Hiring! Seeking passionate Flex, C#, or C++ (RTSP, H264) developer. Position is in the Washington D.C. metro area. Contact careers@...
_______________________________________________
fluorine mailing list
fluorine@...
http://fluorine.thesilentgroup.com/mailman/listinfo/fluorine_fluorine.thesilentgroup.com
« Return to Thread: Interface mapping
| Free Forum Powered by Nabble | Forum Help |