The MFC Document / View model is an attempt at midfield MVC. If you are thinking about using MFC, you can use the CView class to represent the view (duh!) And the class derived from CDocument to represent the model. Unfortunately, MFC is not really trying to keep the controller functionality separate from the model or view.
In the SDI Doc / View application, the event-related nature of the Windows GUI makes it gracefully easy to put some controller functions into the view - and most of the code created by the wizard in MFC does this.
In the MDI application, there are several views for each model, and obviously, it is wrong for any of them to be a controller, so the temptation is to put the controller logic in a document class or in a frame window ... but itβs easy to add a new one class to control the controller and use it to transfer domain logic. However, plumbing this class in the MFC is a battle, and most people do not seem to be bothered. The easiest approach is to simply consider the document as a model and controller rolled into one.
This is for MFC (which, despite its many shortcomings), still remains one of the most productive platforms for writing Windows-based graphics applications only in C ++. If you do not need MFC or you need an infrastructure that supports multiple platforms, you may already have better MVC support - see this article with MVC support in Qt, for example.
source share