views:

353

answers:

2

Has anyone had experience with flourineFX? I have to fix something that uses fluorineFX on the backend to provide typed objects to the a flex presentation layer.

I was under the impression that if I register the objects in Flex like so

registerClassAlias("Kanpeki.Domain.Staff", Staff);

[Bindable]
public class Staff implements IListable
{
 private var _id:int;
 private var _firstName:String;
 private var _lastName:String;
 private var _email:String;

  public function Staff(){}....etc

and if the properties and their types matched the corresponding .Net class I wouldn't have to convert the objects. However, when I bring the classes into flex I am just getting generic objects. Does this mean I must manually convert the objects? I hope that makes sense. Also,I am presuming that webOrb is similar, so if any one has any experience with either flourine or webOrb and can give me any pointers, I'd be most grateful. Thanks

A: 

Seemed to work if I put

registerClassAlias("Kanpeki.Domain.Staff", Staff);

in the root of the app and not the class. Hmmm....

+1  A: 

This problem might occur when you do not reference the Staff class anywhere in your application. Even if you add the mapping via registerClassAlias or via RemoteClass metadata, the compiler will not pick up your class and hence when objects come in, they will not be mapped correctly.

If you add registerClassAlias to the root of your app it will always result in the Staff class being compiled in the app.

Btw: to register an alias with metadata, just add

[RemoteClass(alias="Kanpeki.Domain.Staff")]

in your class file. Of course, the same compiler rule applies. Reference it somewhere or it won't be compiled.

Christophe Herreman