Flex best practices? [closed]

末鹿安然 提交于 2019-12-03 12:47:48

I work often with Flex in my job, and I will be happy to help.. but your questions deserve an article for each one :) I'll try some short answer.

Maintenable code: I think that the same rules of any other OO languages apply. Some flex-specific rules I'm use to follow: use strong typed variables, always consider dispatching events as the way for your UI components talk each other (a little more initial work, very flexible and decoupled later).

Frameworks: looked at it, read the documentation.. very nice, but I still feel that their complications are not balanced by the benefits they provide. Anyway I'd like to change my mind on this point..

Talking with server: Right now I'm using BlazeDS, it works very well.. there are many tutorials on the subject out there, if you find any trouble setting up it I would be happy to help.

Latency: Do you mean in client/server comunications? If so, you should explore the various type of channels BlazeDS implements.. pull-only, two-way http polling, near real-time on http (comet).. if you need more, LiveCycle Data Services ES, the commrcial implementation from which BlazeDS is born, among other things offer another protocol called RTMP, it isn't http-tunnelled so there can be problem with firewalls and proxies, but it offers better performance (there is a free closed-source version of LCDS). I use the standard http channels in intranet environments, and found no real performance problems even with large datasets.

Well.. quite a lot of stuff, can't be more specific now on each of this points, ask you if need :)

Here are a couple of great resources to do with Flex/AS3 best practices and standards:

Flex SDK coding conventions and best practices

Flex best practices – Part 1: Setting up your Flex project

The first one I found especially useful and I try to make sure any team I work with have all read it

I have found the MVC framework RIAWave link to be absolutely incredible. It is super lightweight and easy to use. I found Cairngorm and PureMVC to have a pretty steep learning curve and they both feel a bit too bulky for me. RIAWave stays out of the way and just gives you the MVC basics to work with.

AMFPHP on the backend is very nice as well. AMFPHP also has an apache module that will take care of serializing/unserializing the sent and received data all in C which is blazing fast.

If latency is a worry, you will want to make sure you get a good webhost or even deploy to multiple data centers so that your users are never far from a server. Sounds like a bit early to be worrying about that though.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!