Flex 应用程序框架——PureMVC 可移植性与 Swiz?

发布于 2024-08-14 05:59:23 字数 654 浏览 8 评论 0原文

我的公司正在构建一个 Flex 应用程序,我们可能需要将其移植到其他平台:

  • Silverlight(可能)
  • 移动(可能 - iPhone:Objective-C、Android:Java 等)
  • 桌面(可能 - AIR、.NET 等) .)
  • 电视机(也许最终)

目前,我正在研究要构建的应用程序框架,并且在 pureMVC 和 Swiz 之间左右为难。

我喜欢 swiz,因为它很简单,而且它为你提供了一种将事物连接起来然后应用你自己的模式的方法。从仅弯曲的角度来看,这是我的第一选择。

但是,PureMVC 是独立于平台的,并且已经移植到上面提到的大多数平台。 这种可移植性有多大价值?在移植和开发/维护多个应用程序时,它真的会让我们的生活变得更加轻松吗?如果是这样,那么 PureMVC 似乎是正确的选择。

或者,由于 Silverlight 具有最明确的应用程序移植业务案例,也许我们可以将 Swiz 移植到 Silverlight?我不太熟悉 Swiz 依赖于哪种 AS3 语言和 Flex 框架功能以及它们是否在 C#/Silvelright 中可用。 这实际上可能吗?

非常感谢!

卡蒂克

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 the 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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

_失温 2024-08-21 05:59:23

在我看来,如果您使用 pureMVC,您可以移植到一种新语言,而不需要太多麻烦(除了新语言会给您带来的麻烦)您的命令、中介和代理,只要您将中介程序编程到一个接口即可具体组件实现的一部分,代理使用服务层从服务器获取数据。这样,您只需用新语言实现组件和服务层。

快速浏览一下 Swiz 框架:

  • 使用 flash 事件模型(请参阅 CentralDispatcher)
  • 使用一些 flash.net 和 mx.rpc 类(请参阅 net 和 rpc swiz 包)

PureMVC 框架不使用 flash 事件模型,并且最终 flash .net/mx.rpc 引用通常出现在服务层中。另一方面,Swiz 似乎旨在充分利用 flex 和 mxml 格式,因此它可能会更快地完成工作。因此,您可能还需要考虑将 Swiz 用于 Flex,将 PureMVC 用于其他语言。

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.

司马昭之心 2024-08-21 05:59:23

任何框架,包括 Swiz,都可以很容易地移植到几乎任何语言。 Actionscript 是 Touring Complete 语言,因此理论上用 ActionScript 编写的任何代码都可以转换为另一种 Touring Complete 语言。例如,我们在移动应用程序中使用 Swiz 框架,该框架经过交叉编译以在 iOS 中运行。还有许多其他适用于各种语言的开源交叉编译器,以及 Adob​​e 的 Alchemy 项目

在 Swiz 中唯一不容易移植的是运行时元数据标签的使用。这可以通过使用高级搜索和替换实用程序或自定义转换框架将自定义元数据标签转换为其本机代码实现来解决。希望我们很快就能看到一些很酷的新开源工具,既然 Flex 4.5 已随 一起发布自定义编译器挂钩

简而言之,在决定框架时我什至不会考虑可移植性。选择最适合您或您的开发人员使用的一种。我个人更喜欢Swiz。

干杯!

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!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文