• <tfoot id='e3E2C'></tfoot>
  • <small id='e3E2C'></small><noframes id='e3E2C'>

  • <legend id='e3E2C'><style id='e3E2C'><dir id='e3E2C'><q id='e3E2C'></q></dir></style></legend>

  • <i id='e3E2C'><tr id='e3E2C'><dt id='e3E2C'><q id='e3E2C'><span id='e3E2C'><b id='e3E2C'><form id='e3E2C'><ins id='e3E2C'></ins><ul id='e3E2C'></ul><sub id='e3E2C'></sub></form><legend id='e3E2C'></legend><bdo id='e3E2C'><pre id='e3E2C'><center id='e3E2C'></center></pre></bdo></b><th id='e3E2C'></th></span></q></dt></tr></i><div id='e3E2C'><tfoot id='e3E2C'></tfoot><dl id='e3E2C'><fieldset id='e3E2C'></fieldset></dl></div>

        • <bdo id='e3E2C'></bdo><ul id='e3E2C'></ul>

      1. MVC 方法与 C++

        时间:2023-10-07

            • <bdo id='JX3EC'></bdo><ul id='JX3EC'></ul>
            • <small id='JX3EC'></small><noframes id='JX3EC'>

                <tbody id='JX3EC'></tbody>
              <i id='JX3EC'><tr id='JX3EC'><dt id='JX3EC'><q id='JX3EC'><span id='JX3EC'><b id='JX3EC'><form id='JX3EC'><ins id='JX3EC'></ins><ul id='JX3EC'></ul><sub id='JX3EC'></sub></form><legend id='JX3EC'></legend><bdo id='JX3EC'><pre id='JX3EC'><center id='JX3EC'></center></pre></bdo></b><th id='JX3EC'></th></span></q></dt></tr></i><div id='JX3EC'><tfoot id='JX3EC'></tfoot><dl id='JX3EC'><fieldset id='JX3EC'></fieldset></dl></div>

                <legend id='JX3EC'><style id='JX3EC'><dir id='JX3EC'><q id='JX3EC'></q></dir></style></legend>
                1. <tfoot id='JX3EC'></tfoot>
                2. 本文介绍了MVC 方法与 C++的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我一直在学习 PHP MVC 模式,它非常酷.几乎完成了应用程序,我可以看到如果没有良好的设计,您可以制作出多么混乱的代码.现在可以将 MCV 应用于 C++ 应用程序吗?如果可能的话,插件管理器/插件会去哪里?在模型还是控制器中?谢谢!

                  I have been learning PHP MVC pattern and it is pretty cool. have almost finished app and I can see how mess you can make a code without good design. Now can MCV be applied to C++ apps? Where does Plugin manager/Plugins go if that is even possible?In model or controller? Thanks!

                  我的意思是带有像 QT/Wxwidgets/GTK+ 这样的 GUI 工具包的 C++另外请帮助我如何在 C++ 中实现.我已经学会了如何在 PHP 中做到这一点,但正如您所知,这两种语言在某种程度上是不同的!

                  I mean C++ with GUI toolkit like QT/Wxwidgets/GTK+ Also Please help me on how to implement in C++. I have learned how to do it in PHP but as you know the two languages are somehow different!

                  EDIT2

                  http://forums.wxwidgets.org/viewtopic.php?f=1&t=30983

                  推荐答案

                  你如何在 C++ 中实际实现它

                  how do you actually implement it in C++

                  • 让负责渲染的类对应用程序的细节一无所知.将它们称为SomethingView 类以明确这一点

                    • make classes in charge of rendering know nothing about application details. Call them SomethingView classes to make this point clear

                      让你的领域对象对可视化或用户交互一无所知.你不需要称它们为模型,但你可以

                      make your domain objects not know anything about visualization or user interaction. You don't need to call them Model, but you could

                      创建一组负责运行控制器角色的类:如果可能的话,通过依赖注入以某种方式将依赖连接到视图和模型类.示例:CppInject.在任何情况下,控制器类都可以知道模型和视图类,所以重要的部分是:视图和模型对象之间的所有耦合都与控制器隔离.

                      create a set of classes in charge of running the role of Controllers: wire somehow dependencies to view and model classes via dependency injection if possible. example: CppInject. In any case, controller classes can know both about model and view classes, so the important part is this: all the coupling between view and model objects is isolated to the controllers.

                      此外,这意味着所有命令式编程也应该局限于控制器类:视图和模型应该是声明式的.这意味着,他们应该提供与其角色相关的服务,但避免与其他对象直接交互作为副作用

                      Also, this implies, that all imperative-style programming should be confined to the controller classes as well: view and model should be declarative-style. That means, they should offer services related to its role, but avoid direct interaction with other objects as side-effects

                      你不需要用事件式系统来实现控制器和其他组件之间的通信,虽然这样的系统肯定有帮助,但肯定不是必需的

                      It is not true you need to implement communication between controllers and the other components with event-style system, although such system is definitely helpful, but certainly not required

                      惊喜! 以上适用于任何语言或框架,当然除了那些从一开始就以某种方式迫使 MVC 扼杀你的语言,即:ruby on rails

                      surprise! the above applies to any language or framework, except of course languages that somehow already force MVC down your throat from the start, i.e: ruby on rails

                      这篇关于MVC 方法与 C++的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:FFmpeg C++ H264 解码错误 下一篇:设计模式、Qt 模型/视图和多线程

                  相关文章

                  最新文章

                  <small id='WreF5'></small><noframes id='WreF5'>

                    <bdo id='WreF5'></bdo><ul id='WreF5'></ul>
                  <i id='WreF5'><tr id='WreF5'><dt id='WreF5'><q id='WreF5'><span id='WreF5'><b id='WreF5'><form id='WreF5'><ins id='WreF5'></ins><ul id='WreF5'></ul><sub id='WreF5'></sub></form><legend id='WreF5'></legend><bdo id='WreF5'><pre id='WreF5'><center id='WreF5'></center></pre></bdo></b><th id='WreF5'></th></span></q></dt></tr></i><div id='WreF5'><tfoot id='WreF5'></tfoot><dl id='WreF5'><fieldset id='WreF5'></fieldset></dl></div>
                  1. <legend id='WreF5'><style id='WreF5'><dir id='WreF5'><q id='WreF5'></q></dir></style></legend>
                    1. <tfoot id='WreF5'></tfoot>