Skip to content
ccapndave edited this page Jan 23, 2012 · 6 revisions

Why hasn't this been done before?

Similar solutions exist for Java backends using LiveCycle Data Services, GraniteDS, JPA and Hibernate. However, until Doctrine 2 popular ORM systems for PHP required your entities to extend some base class which caused massive problems for AMF class mapping and communication. Doctrine 2 doesn't mess with your domain model at all which makes it perfect for AMF serialization.

What licence is Flextrine released under?

As on January 2012 Flextrine is released until the MIT licence.

Can I use Flextrine in a proprietry software project?

Yes.

Doesn't Flash Builder 4 have this built-in?

Flash Builder 4 has some support for remote PHP services using Zend_Amf, and includes auto-code generation that builds remote services to access your database. However, this is really an RPC rather than an ORM solution.

How is this different from FlexORM?

FlexORM is an excellent project and similar in some ways to Flextrine, but works using AIR's embedded SQLite database so is no use for browser based applications.

Does it work with Flex 4?

Flextrine works with Flex 4.

Does it work with Flex 4.5?

Flextrine works with Flex 4.5

Does it work on Flex mobile (Android, iOS, Blackberry)?

As far as I know, yes. I have tested it on Android 2.2 and everything seemed to work perfectly. I haven't tested it on iOS or Blackberry (because I haven't got any), but I see no reason why it wouldn't work.

Can I use Flextrine with the Flash IDE?

Flextrine makes use of MXML auto-generated code (specifically the Bindable and RemoteObject tags) and the mx.collections frameworks so at present it is Flex only. If there is enough interest there is the potential to adapt Flextrine to work with the Flash IDE in the future.

Can I use Flextrine with pure AS3?

Yes - Flextrine works with pure AS3 compiled with the Flex Compiler even if it doesn't use any MXML or the Flex framework. However, you need to add the following code to the root Sprite of your application in order to get the relevant bits of Flex compiled into the SWF.

LoaderConfig.mx_internal::_url = loaderInfo.url;
LoaderConfig.mx_internal::_parameters = loaderInfo.parameters;

registerClassAlias("org.davekeen.flextrine.orm.PersistentCollection", PersistentCollection);
registerClassAlias("flex.messaging.io.ArrayCollection", ArrayCollection);
registerClassAlias("flex.messaging.io.ArrayList", ArrayList);
registerClassAlias("flex.messaging.io.ObjectProxy", ObjectProxy);
registerClassAlias("flex.messaging.config.ConfigMap", ConfigMap);
registerClassAlias("flex.messaging.messages.ErrorMessage", ErrorMessage);
registerClassAlias("flex.messaging.messages.CommandMessage", CommandMessage);
registerClassAlias("flex.messaging.messages.RemotingMessage", RemotingMessage);
registerClassAlias("flex.messaging.messages.AcknowledgeMessage", AcknowledgeMessage);
registerClassAlias("flex.messaging.messages.MessagePerformanceInfo", MessagePerformanceInfo);
registerClassAlias("DSA", AcknowledgeMessageExt);
registerClassAlias("DSC", CommandMessageExt);

// All entities must be registered here
registerClassAlias("vo.Session", Session);
registerClassAlias("vo.Category", Category);

Notice that you need to register all your entities manually at the bottom (I have put in two example entities, but obviously they will be different depending on your project).