HttpService 与远程对象
我有一个 Flex 应用程序,需要将实时数据显示到聊天室和数据网格中。
早期,我们使用 Httpservices 将实时数据和历史数据显示为图表和数据网格。但现在我们要将 Httpservice 替换为远程对象。
那么一般哪些地方需要改变。我对远程对象有一点了解。
谢谢, 拉维
I have a flex application and need to show the real time data into the chatrs and datagrids.
Eralier we are used Httpservices to showing the real time data and historical data into charts and datagrids. But now we are going to replace the Httpservices to remote objects.
So which places generally need to change. I have a little bit idea about remote objects.
Thanks,
Ravi
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您需要显示实时数据(或“接近实时”),您应该使用某种推送机制 - 查看 BlazeDS 并阅读有关轮询和流的信息。
如果您只需要用远程对象替换 Web 服务,则需要将处理 xml 响应(提取数据等)的代码替换为处理远程调用返回的对象的代码。使用强类型对象不是强制性的,但它会有所帮助。
If you need to display real time data (or "near real time") you should use some kind of pushing mechanism - take a look on BlazeDS and read about polling and streaming.
If you just need to replace your webservices with remote objects you will need to replace the code dealing with the xml response (extracting data etc) with the code dealing with the objects returned by the remote calls. It is not mandatory to use strongly typed objects, but it will help.
如果您打算用
RemoteObject
替换您的HTTPService
,有些问题您需要自己反驳。您要实现什么框架(如果有),然后检查其
RemoteObject
Invoker
标记(如果有)。您的resultEvent 和FaultEvent 将根据您要应用的框架而有所不同。
如果您要使用 Flex 默认
RemoteObject
那么您需要将所有
HTTPService
替换为RemoteObject
标记。您的后端代码还需要对业务逻辑进行一些更改,这些更改应该进入方法中,并返回一个对象的
function
或method
的结果。最后一个建议。
为什么不使用远程对象,而使用 Web 服务呢?您也可以在其他地方重复使用这些组件。
更新了有关
Cairngorm
的链接http://www.adobe.com/devnet/flex/articles/cairngorm_pt5_03.html
http://www.jeffryhouser.com/index.cfm/2007/2/19/Learning-Cairngorm-Part-3
http://www.asfusion.com/blog/entry/hello-world-cairngorm-example< /a>
http://justjoshn.com/entry/contact-manager -part-2-cairngorm-example
谢谢
If you are going to replace your
HTTPService
withRemoteObject
, some questions you need riposte yourself.What framework are you going to implement, if any then check their
RemoteObject
Invoker
Tag if any.Your resultEvent and FaultEvent will vary according to the framework you are going to apply.
If you are going with Flex default
RemoteObject
Then you need to replace all your
HTTPService
withRemoteObject
tags.Your backend code also requires some changes with business logic should get into methods with the result of
function
ormethod
returning an object.Finally a suggestion.
Instead of going with Remote Objects, why not go with Webservice. You can re use the components somewhere else too.
Updated links about
Cairngorm
http://www.adobe.com/devnet/flex/articles/cairngorm_pt5_03.html
http://www.jeffryhouser.com/index.cfm/2007/2/19/Learning-Cairngorm-Part-3
http://www.asfusion.com/blog/entry/hello-world-cairngorm-example
http://justjoshn.com/entry/contact-manager-part-2-cairngorm-example
Thanks