views:

139

answers:

1

Hello!

I was wondering what is considered to be a best practice when I have multiple components and use RemoteObject for AMF communication with a PHP backend.

  1. Have the RemoteObject in the Main.mxml file with all the methods declared here (with handlers and all) and have all components call functions from the parentApplication, thus having a centralized result and fault handling, but making reusiability more difficult.

  2. Have a RemoteObject in each component with only the methods (and handlers) relevant to that component, thus making it easy to have clean, reusable components.

Thank you.

A: 

Maybe you should think about using a framework (e.g. mate). IMHO it's better to have all services in one place, so I would tend to Nr. 1 but If you have the possibility to use a framework, you should do so. (In mate it's a best practice to have one MXML with all RemoteObjects in it)

hering
Thanks, but for now I am not looking to use Mate. Maybe for future projects.
Francisc