用 MFC 替换控制台应用程序接口
我有一个用 C++ 编写的电话簿程序,它使用 MVC 模型,现在我想要的是用 MFC 替换 View 组件(基本上是控制台窗口)。我该怎么做呢?
I have a phone-book program written in C++, that uses the MVC model, now what I want is to replace the View component, that's basically the console window, with an MFC. How would I do that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
以下是MVC的示意图。
View
组件与Model
和Controller
是有损耦合的,这就是 MVC 设计模式背后的全部要点。在不改变View外部接口的情况下,你应该能够轻松地用MFC替换内部实现。这就是你应该做的。这个问题非常广泛,无法详细回答任何问题,如果您可以发布示例代码,那么我们可能可以更好地帮助您。
Following is a schematic representation of MVC.
View
component is lossely coupled from theModel
and theController
and that is the whole point behind MVC design pattern. Without changing the external interfaces of View, you should be easily able to replace internal implementation by MFC. And that is what you should do.The question is very broad to answer anything more in detail, If you can post a sample code then probably we can help you better.