对于 Flash 项目,是否有 PureMVC 更好的替代方案?

发布于 2024-07-14 14:51:41 字数 410 浏览 7 评论 0原文

我在之前的 Flash(不是 Flex)项目中使用过 PureMVC。 在适应了它的要求之后,它运行得很好,但我觉得它设计得太过分,太麻烦了。 我注意到 Mate 由于其清晰和简单而获得了很多积极的评价,但它仅适用于 Flex 项目,不是闪存。

在 Flash 中不使用像 PureMVC 这样的框架来维护我自己的 MVC 分离是否会更简单/更清晰,或者是否有 PureMVC 的更好替代方案?

编辑:我发现的唯一轻量级竞争者是 flashMVC

I used PureMVC in a prior Flash (not Flex) project. After adjusting to its requirements, it worked well, but I'm left feeling that it was too over-engineered and cumbersome. I noticed that Mate had lots of positive reviews due to its clarity and simplicity, but it is only for Flex projects, not Flash.

Would it be simpler/clearer to just maintain my own separation of MVC without a framework like PureMVC in Flash, or are there any better alternatives to PureMVC?

Edit: The only lightweight contender I found was flashMVC.

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

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

发布评论

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

评论(6

巷雨优美回忆 2024-07-21 14:51:41

您需要锤子、木槌还是鞋子?

没有一个答案。框架的好坏取决于它的预期用途。

我想说的是,没有一个最终的解决方案是可以的。 逐个项目进行。 自从 AS 第一次存在以来,我就一直在编写 AS 代码,并且一直在研究这些问题,结果发现除此之外没有任何客观的答案。

祝你好运!

Do you need a hammer, a mallet, or a shoe?

There is no one answer.. A framework is only as good as it's intended utilization.

what I'm saying is it's ok that there isn't ONE ultimate solution. take it project by project. I've been coding AS since AS first existed and have spun my wheels on these questions only to find there is no one objective answer other than that.

good luck!

陈甜 2024-07-21 14:51:41

您可以尝试 Gaia (http://www.gaiaflashframework.com/)。 它更像是一个前端框架,但我确信有总比没有好。 您可以构建一个非常简单的后端并与其完美搭配。

可能值得一试。

You could try Gaia (http://www.gaiaflashframework.com/). It's more of a front-end framework, but I'm sure its better than nothing. You could build a very simple back end that would pair nicely with it.

Could be worth a try.

农村范ル 2024-07-21 14:51:41

事实上,我发现 PureMVC 的工程设计比大多数框架要少,并且可以通过可重用代码更好地在 Flash 和 Flex 之间跳转。 如果你真的想要“最佳替代方案”,你最好的选择是推出自己的框架,但我认为构建在 Pure 之上的“个人”框架可能会非常热门(这就是我现在正在使用的)......虽然是负载。 查看此链接上的 OOP 框架部分:

http://www.adrianparr.com/?p= 83

I actually found PureMVC to be less engineered than most frameworks out there and nicer to jump between Flash and Flex with reusable code. Your best bet is to roll your own if you truly want the "best alternative" but I think a "personal" framework that's built on top of Pure could be very hot (that's what I'm working with right now) ... there are loads though. Check out the OOP frameworks section on this link:

http://www.adrianparr.com/?p=83

多情出卖 2024-07-21 14:51:41

您可以尽快尝试一下。 它太酷了。

You can give ASAP a try. It's pretty cool.

樱娆 2024-07-21 14:51:41

请查看 Swiz。 虽然该项目本身声明它是一个 Flex 框架,但实际上只有一个文件依赖于 MXMLC(Beans.mxml 文件)。 可以按照Aral 博客上的示例将其重新加工成 ActionScript 文件。

从架构上来说,Mate 和 Swiz 在提供的功能方面非常相似。 它们都是 MVC 框架,并且具有许多相同的基本思想。 关键的区别实际上只是实现细节。 例如,在 Mate 中您有一个事件地图,而在 Swiz 中您可以通过 [Mediate] 来处理事件。 Mate 使用 MXML 标签处理事件,Swiz 通过编写 ActionScript 事件处理程序方法来处理事件。 此外,在 Mate 中,您可以在映射内使用注入器进行依赖项注入,而在 Swiz 中,您可以使用 [Autowire]。

Have a look at Swiz. While the project itself states that it is a Flex framework, there is really only one file that relies on MXMLC (the Beans.mxml file). This can be reworked into an ActionScript file by following Aral's example on his weblog.

Architecturally, Mate and Swiz are a lot alike in regards to what they offer. They are both MVC frameworks and share a lot of the same fundamental ideas. The key differences are really just the implementation details. For example, in Mate you have an Event map and in Swiz you [Mediate] to handle events. Mate handles events using MXML tags, Swiz handles events by writing ActionScript event handler methods. Additionally, in Mate you use Injectors inside of a map for dependency injection and in Swiz you [Autowire].

花落人断肠 2024-07-21 14:51:41

虽然我的回答有偏见,因为我是 FlashMVC (www.flashmvc.com) 的作者,但我确实认为它具有最高的灵活性,同时尽可能易于实施。 需要一条 import 语句,整个框架大约有 3 个类。 一个 hello-world 示例可能只有几行代码,而 PureMVC 可能有几十行。 我已经在非常小的项目和工业规模的构建中使用了它。

Although my answer is biased as I am the author of FlashMVC (www.flashmvc.com), I do hold that it was made to have the highest flexibility while being as easy as possible to implement. There's one import statement needed and the whole framework is about 3 classes. A hello-world example can be just a couple lines of code as oppose to PureMVC which can be dozens. I have used it on both really small projects to industrial size builds.

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