Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<blockquote> <p>how do you actually implement it in C++</p> </blockquote> <ul> <li><p>make classes in charge of rendering know nothing about application details. Call them SomethingView classes to make this point clear</p></li> <li><p>make your domain objects not know anything about visualization or user interaction. You don't need to call them Model, but you could</p></li> <li><p>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: <a href="https://github.com/admiyo/CppInject" rel="noreferrer">CppInject</a>. In any case, controller classes can know both about model and view classes, so the important part is this: <strong>all the coupling between view and model objects is isolated to the controllers</strong>. </p></li> <li><p>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 <strong>offer services related to its role, but avoid direct interaction with other objects as side-effects</strong></p></li> <li><p>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</p></li> <li><p><em>surprise!</em> 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</p></li> </ul>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload