使用 flex 4(MATE MVC) 和 MSMQ 集成
我正在空气中做一个应用程序(flex4),因为这是我的第一个应用程序,我需要一些建议来完成集成部分。
我的系统和后端之间的所有集成都必须使用 MSMQ 完成,好吧,我听说过一些库可以导入到我的 Flex 项目中以在 MSMQ 队列中放置和读取消息,但这不是我的双体,我我想知道,这是如何进行这种通信的好方法,我的意思是,我是否应该有一个名为 MSMQService 的动作脚本类,并且在那里,我应该具有在队列中放入和读取的功能?或者我应该在 Mate 中创建一个新的自定义标签,并有单独的 eventMap 只是为了处理集成?!我知道有很多方法,但如果有人已经这样做了,我想知道你是怎么做的,比如一些好的模式。
感谢您的帮助!
I`m doing an application in air(flex4), as this is my first app, I need some advices to do the integration part.
All integration between my system and the back-end have to be done using MSMQ, alright, I have heard some libs that I can import inside my flex project to put and read messages in the MSMQ queue, but this is not my doublet, I would like to know, how it`s a good approach to do this communication, what I mean is, should I have an actionscript class, called for example MSMQService, and there, I should have the functions to put and read in the queue? or should I create a new custom tag in Mate, and have separate eventMap just to deal with the integration?! I know that there are lots approach, but if someone already done that, I would like to know how you did, like some good patterns.
Thanks for all help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
首先,我从未使用过 MSMQ,我的答案通常是 Mate 和服务器通信(基于我的观点和 3 个月的经验)。
其次,我认为您的通信类不需要另一个
eventMap
。我当前项目的结构概述:
eventMap
和一堆事件。eventMap
包含“什么 view.event 触发什么 model.function”的逻辑。 “eventMap”中不得有任何计算或其他应用程序逻辑。modelMap
负责绑定模型和视图之间的单向链接,描述当模型中的某些内容发生更改时视图类 (UI) 中必须更改的内容。 modelMap 不得允许视图类直接操作模型,这违反了 MVCMATE 逻辑:
1.) 某些视图类被操纵,并且该视图发送了一些事件。示例:具有名称和密码的用户按下登录按钮 (RegisterScreen.mxml)
2.)
eventMap
实例接收EventHandler
中的事件并调用中的某些方法ServerCommunicationManager
类。示例:3.) 调用模型类方法。示例:我的示例已失效!
4.) 返回
EventMap
和
modelMap
:概述:在这种方法中,您可以成功地将视图类与通信类分离。到目前为止,它在我们的项目中运行稳定。
编辑:由于我对 Mate 比较陌生,如果有人发现我的方法有错误,他必须对此发表评论。如果其中某些逻辑部分或完全错误,这对我来说非常重要。
First, I've never used MSMQ and my answer will be generally for Mate and server communication(due to my point of view and 3 months experience).
Second, I don't think that your communication classes need another
eventMap
.Overview of the structure of my current project:
eventMap
and bunch of events. TheeventMap
include logic for 'what view.event triggers what model.function'. There must be NO calculations or other application logic in the 'eventMap'.modelMap
responsible for binding the one direction link between model and view, describing what must change in the view classes (UI) when something is changed in the model.modelMap
MUST NOT allow the view classes to directly manipulate model, it is against principles of MVCMATE logic:
1.) Some View class is manipulated and this view sent some event. Example: user with name and password presses the login button (RegisterScreen.mxml)
2.) The
eventMap
instance receives the event inEventHandler
and invokes some method in theServerCommunicationManager
class. Example:3.) The model class method is invoked. Example: my example is stubbed!
4.) Back in the
EventMap
And in the
modelMap
:Overview: In this approach you can successfully decopulate view classes from communication classes. It works stable so far in our project.
Edit: Since I'm relatively new to Mate, if someone see errors in my approach he MUST make a comment about it. It really important for me if some of this logic is partially or entirely wrong.