模型视图控制器框架中的通信
我正在测试 C# 项目中尝试模型视图控制器模式。在我的项目中,我希望能够接收会影响模型的消息,并在模型以某种方式更改时通过套接字发送消息。我还想让用户从用户界面(视图)发送消息。发送和接收应该怎样处理?我认为它应该放入控制器中,这会在接收时适当地更改模型,因此模型或视图会调用控制器来发布消息,但 MVC 模式对我来说有点陌生,所以我不确定。
想法?
I'm trying out the Model View Controller Pattern in a test C# project. In my project I want to be able to receive messages that will affect the model, and send a message over a socket when a Model is changed in a certain way. I also want to be have the user send messages from the UI ( view ). What should handling the sending and receiving ? I think it should go in the controller, which would change the model appropriately when receiving, and so the model or view would call on the controller to post a message, but the MVC pattern is a bit foreign to me so I'm not sure.
Thoughts ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这里要明确一点 - 您是否希望在 winforms 客户端(或 wpf)或网络上执行此模式? ASP.Net MVC 就是这样 - 对于 MVC,虽然这并不意味着你不能将这种模式适应 winform,但现在的实现是针对 ASP.Net
To be clear here - are you looking to do this pattern in a winforms client (or wpf) or on the web? ASP.Net MVC is just that - for MVC, although it doesn't mean you can't adapt this pattern to winform but the implementation now is for ASP.Net