1
votes

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.

1
I'm looking for the answer to this question also! I'm not using a Flex framework, but I am using a typical architecture: the Spring Flex Integration project, does anyone else have any thoughts on this? @Francisc , do you have any update?blong
Nope. I have used the second approach because it's more modular and easier to scale. But I don't know which is better if such a classification can be made.Francisc

1 Answers

0
votes

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)