开发者

Flex Application Framework -- PureMVC Portability vs. Swiz?

My company is building a Flex application that we may need to port to other platforms:

  • Silverlight (likely)
  • Mobile (maybe -- iPhone: Objective-C , Android: Java, etc.)
  • Desktop (maybe -- AIR, .NET, etc.)
  • TV sets (maybe eventually)

Currently, I’m looking into application frameworks to build upon and I’m torn between pureMVC and Swiz.

I LOVE swiz for its simplicity and how it just gives you a way to hook things up and then apply your own patterns. From a flex-only perspective, this is my 1st choice.

But, PureMVC is platform-independent and has already been ported over to most of the platforms that are mentioned above. How valuable is this portability? Will it really make our lives significantly easier when it comes to porting and developing/maintaining multiple applications? If so, then it seems like PureMVC is the way to go.

Alternatively, since Silverlight has 开发者_StackOverflowthe most definite business case for porting of our application, maybe we could port Swiz to Silverlight? I'm not too familiar with which AS3 language and Flex framework features Swiz depends on and whether they are available in C#/Silvelright. Would this actually be possible?

Thanks so much!

Karthik


The way I see it, if you used pureMVC you could port to a new language, without too much trouble (other than what the new language will give you) your commands, mediators and proxies, provided you program your mediators to an interface, instead of a concrete component implementation, and the proxies use a services layer to get the data from server. That way you'll only have to implement the components and the service layer in the new language.

A quick look at the Swiz framework:

  • uses the flash event model (see CentralDispatcher)
  • uses some flash.net, and mx.rpc classes (see net and rpc swiz packages)

PureMVC framework doesn't use the flash event model, and eventual flash.net/mx.rpc references would normally appear in the service layer. On the other hand Swiz seems to be aimed at taking full advantage of flex, and the mxml format, so it might get the job done faster there. So you might also want to consider using Swiz for flex and PureMVC for the other languages.


Any framework, including Swiz, can very easily be ported to just about any language. Actionscript is touring complete, so theoretically any code writen in actionscript can be transformed into another touring complete language. For example, we use the Swiz framework in our mobile apps, which get cross compiled to run in iOS. There are many other open source cross compilers for a variety of languages, as well as Adobe's Alchemy project.

The only thing that is not easily portable in Swiz the usage of runtime metadata tags. This can be solved by using an advanced search and replace utility, or a custom transformation framework to convert custom metadata tags to their native code implementation. Hopefully we will see some cool new open source tools for this soon, now that Flex 4.5 was released with custom compiler hooks.

In short, I wouldn't even take portability into consideration when deciding on a framework. Choose the one which is most comfortable for you or your developers to use. I personally prefer Swiz myself.

Cheers!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜