Remoting可以在課堂內

[英]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 个解决方案

#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.

實際上,Adobe推薦的架構Cairngorm不僅將遠程對象本身抽象為單個類(ServiceLocator類),而且還建議用於處理該類的所有內容也應該被抽象。

The RemoteObject in Cairngorm:
http://www.adobe.com/devnet/flex/articles/cairngorm_pt5_03.html

Cairngorm中的RemoteObject:http://www.adobe.com/devnet/flex/articles/cairngorm_pt5_03.html


注意!

本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:https://www.itdaan.com/blog/2009/07/27/7205e55572b8f790e4072d5d2a0c6c29.html



 
粤ICP备14056181号  © 2014-2020 ITdaan.com