哪个是在我的Flex应用程序中获取数据的最好方法? [英] Which is the best way to get Data in my Flex Application?

查看:166
本文介绍了哪个是在我的Flex应用程序中获取数据的最好方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Flex开发中是新的,当创建一个新的移动项目时,它问我是否要连接到一些服务器,并给我四个选项`ColdFusion,PHP,Java和blazeDS。



我一直在java工作,而不是一个PHP的伙伴,我会简单地选择 Java 并忽略所有其他。但由于效率是我目前的项目中的一个重要的关注,我不想采取一个机会。



根据你哪一个是最好的选择,即ColdFusion,BlazeDS或Java,考虑到事实,大多数时候,我将存储大二进制数据数据库即音频/视频文件等?

解决方案

由于你是一个Java人, PHP选项:它的AMF远程选项比其他3慢,你不想学习一种新的语言。



这让我们的Java,CF和BlazeDS,它们基本上都是Java和性能方面的,它们可以非常相似(如果使用正确:见后文):




  • Java:最基本的选择;我认为这是AMF远程处理的最快选项;加上你知道语言

  • BlazeDS:这实际上是一个Java服务器应用程序,允许你将消息推送到客户端;所以你也可以用Java写;但是如果你不需要添加的功能,不要麻烦

  • ColdFusion:在Java之上的生产力层:无论你喜欢的语言是否由你决定决定(我个人不是一个大粉丝)。您将必须设置ColdFusion服务器。虽然CF服务器的开发版是免费的,但商业版非常昂贵(除非你使用Railo或BlueDragon)。



有一件你需要知道的事情。 CF中的实例化是非常昂贵的 - 我的意思是比Java慢500倍,所以如果你有大的列表它肯定是一个nono。除非你使用我几个月前碰到的伎俩:而不是实例化一个对象,你必须创建一个'struct'并给它一个'__type__'属性。



例如,而不是:

  var instance = new path.to.MyClass(); 
//或
var instance = createObject(component,path.to.MyClass);

这样做:

  var instance = structNew(); 
instance [__ type__] =path.to.MyClass;

并且ColdFusion将会和Java一样快,

我有一些基准来支持。此图像比较了在某些语言中创建50000个实例所需的时间。 (我实际上想告诉我的老板CF真的是多么糟糕。)和CF8(不在图表中)甚至还要慢100倍。





然后我添加了AMF序列化和'typed struct '(如前所述)到此列表,这是结果:





图形中有些列名称丢失,但左侧第二列是纯Java选项。所以使用这种方法,CF9似乎实际上比Java快。


I am new in Flex Development, While creating a new Mobile project it asks me if I want to Connect it to Some Servers and gives me four options `ColdFusion, PHP, Java and blazeDS).

I have worked in java for all the time and not a PHP fellow, I would have simply selected Java and ignored all other. But Since efficiency is an important concern in my current project I dont want to take a chance.

According to you Which one is the best option i.e. ColdFusion, BlazeDS or Java, considering the fact that most of the time I will be storing large binary data in database i.e. Audio / Video files etc.?

解决方案

Since you're a Java guy, you can immediately drop the PHP option: its AMF remoting options are slower than the other 3 and you don't want to learn a new language.

That leaves us with Java, CF, and BlazeDS, which are all basically flavors of Java and performance-wise they can be fairly similar (if used correctly: see further on):

  • Java: the most basic option; I reckon it's the fastest option for AMF remoting; plus you know the language
  • BlazeDS: this is actually a Java server application that allows you to push messages to the client; so you can also write in Java; but if you don't require the added functionality, don't bother
  • ColdFusion: a 'productivity layer' on top of Java: whether or not you like the language is up to you to decide (I personally am not a big fan). You will have to setup a ColdFusion server. Though the developer edition of the CF server is free, the commercial edition is very expensive (unless you use Railo or BlueDragon).

But there's one thing you need to know. Instantiation in CF is terribly expensive - I mean like 500 times slower than Java -, so if you have big lists it's definitely a nono. Unless you use the trick I bumped into a few months ago: instead of instantiating an object you have to create a 'struct' and give it a '__type__' attribute.

example, instead of:

var instance = new path.to.MyClass();
//or
var instance = createObject("component", "path.to.MyClass");

do it like this:

var instance = structNew();
instance["__type__"] = "path.to.MyClass";

and ColdFusion will be just as fast - or maybe even slightly faster - then Java.

I have some benchmarks to back this up. This image is a comparison of how much time it takes to create 50000 instances in some languages. (I was actually trying to tell my boss how crappy CF really is.) And CF8 (not in the chart) is even 100 times slower.

Then I added AMF serialization and the 'typed struct' (as described earlier) to the list and this is the result:

Some column names were lost in the graphic, but the second column from the left is the pure Java option. So with this approach CF9 seems to actually be faster than Java.

这篇关于哪个是在我的Flex应用程序中获取数据的最好方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆