[英]Can Remoting be inside a class

Should i keep Remoting Methods outside a class in a seperate AS file or is it possible to call Remoting inside a class.

我應該將Remoting Methods保存在一個單獨的AS文件中,還是可以在一個類中調用Remoting。

1 个解决方案


It is possible to have your remote objects in the main Application MXML file, but the general rule of thumb is that it is almost always better to move your external calls away from the center of your processes. This will make the code easier to debug, but it will also make the code easier to maintain down the line.

可以將遠程對象放在主Application MXML文件中,但一般的經驗法則是,將外部調用從流程中心移開幾乎總是更好。這將使代碼更容易調試,但它也將使代碼更容易維護。

Actually, Adobe's recommended architecture, Cairngorm, not only abstracts the Remote Objects themselves into a single class (the ServiceLocator class), but they also recommend that everything which is used to handle that class should be abstracted as well.


The RemoteObject in Cairngorm:




粤ICP备14056181号  © 2014-2021