开发者

Flex 4 Best Practice when using RemoteObject and multiple components

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, b开发者_JAVA技巧ut 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.


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)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜