打火机&更快的机器人腿工作流程:可能更好还是有太多缺点?

发布于 2024-10-04 14:47:19 字数 909 浏览 2 评论 0 原文

目前我正在使用基于python的flex4+robotlegs+as3signals+google应用程序引擎构建一个相当大的应用程序。

1)好吧,问题是我发现自己从视图到调解器以及从调解器到上下文重新分配相同的信号。

2)另一个问题是我正在执行来自中介者的信号命令,这些中介者仅在模型上运行 1 个方法。

请记住,使用 Flex 4 时,皮肤可能与业务逻辑分离。 所以我有一个皮肤、该皮肤的一个组件 (SkinnableComponent) 和一个模型。这是我的新方法:组件在皮肤上监听。该组件具有强类型模型对象(注入)并直接调用方法。该组件侦听要调度的模型信号。这就是组件的全部内容。中介者在组件中进行转换。并且该命令没有被使用。

现在的问题是: 不要将视图(在我的例子中我称之为组件)映射到中介器,只需映射没有附加中介器的组件,因为未使用中介器。然后允许组件使用 [Inject] 元标记。

这就是我所需要的,关于如何实现它有什么想法吗? 当然,我很高兴听到您的意见和批评,它总是有助于改进;)

感谢您的宝贵时间! ;)

代码:

[皮肤] 调度由用户引起的事件

[Component] 就像一个中介者,但有很大不同,因为它扩展了 SkinnableComponent。 捕捉皮肤事件。有一个强类型模型。然后调用模型上的直接方法。听模型。当模型调度事件时,组件的状态会发生变化。

...
[Inject]
public var accountModel:AccountModel;
[Inject]
public var xxxModel:XxxModel;

// then the component run methods on it and listen on it. easy and no complications.

[模型] 他们什么都不知道。只需发送事件或信号。

Currently I'm building quite a large app with flex4+robotlegs+as3signals+google app engine based on python.

1) Well the problem is that I'm finding myself redipsatching the same signals from the view to mediator and from mediator to context.

2) The other problem is that I'm executing commands for signals from mediators that just run 1 method on the model.

Remember that working with flex 4, the skin might be separed from the business logic.
So I have a skin, a component (SkinnableComponent) for that skin and a model. That is my new approach: the component listen on skin. The component has strong typed model objects (injected) and call methods directly. The component listen for model signals to dispatch. That's all for the components. The mediators are converted in the component. And the command is not used.

Now the problem is:
Instead of mapping views (in my case I call them components) to mediators, just map the component with no mediator attached, as is not used. Then allow the component to use the [Inject] metatag.

Just this is what I need, any idea on how to implement it?
And of course, I would be glad to hear your oppinion and critcize on it, it always help to improve ;)

thanks for your time! ;)

Codes:

[Skin]
dispatches the events caused by the user

[Component] is like a mediator, but quite different as it extends the SkinnableComponent.
catch skins events. has a strong typed model. then call direct methods on the model. listen on models. when models dispatch an event the state of component changes.

...
[Inject]
public var accountModel:AccountModel;
[Inject]
public var xxxModel:XxxModel;

// then the component run methods on it and listen on it. easy and no complications.

[Model]
they don't know about nothing. just dispatch events or signals.

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

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

发布评论

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

评论(2

月野兔 2024-10-11 14:47:19

您在这里为自己节省了一个课程,但现在您在视图组件上添加了额外的知识和责任。当然,这会起作用,您可以查看我关于使用 带有 Robotlegs 的演示模型。我不会像你描述的那样推荐它。如果我要以这种方式工作,那肯定是和产品经理一起工作。

You're saving yourself a class here, but you are now adding the extra knowledge and responsibility on your view component. This will work, of course, and you might check out my article on using Presentation Models with Robotlegs. I wouldn't recommend it as you describe. If I was going to work this way it would definitely be with a PM.

瑶笙 2024-10-11 14:47:19

您可能想看看 Adobe TV 文章 /pwalczyszyn" rel="nofollow">Piotr Walczyszyn

他对许多 DI AS3/Flex 框架(包括 Robotlegs)进行了比较。

You might want to have a look at this Adobe TV article by Piotr Walczyszyn

He does a comparison of many DI AS3/Flex frameworks including Robotlegs.

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