开发者

MVC model in MFC

how are the classses in MFC match the model-view-control pattern ?

the model is suppose to handle the Business Logic , the control suppose to be some kind of mediator and the view suppose to be the gui ?

what class in MFC represent each one ? cause it seems pretty different to me as i read more about mf开发者_开发知识库c. (seems like CView represent the control, CfrmWnd the view , and CDocumnet the data- though i'm not sure if by data they mean BL)

clarifications ?


MFC is a Document/View architecture, not a full-blown MVC. Reference MFC Library Reference Document/View Architecture.

In short in MFC the CDocument is the Model, and the CView classes combine the View and Controller aspects.

By "BL" in your question do you mean "business logic"? And in this case the CDocument does not mean business logic, but the actual data underlying your app.


MFC does not implement the MVC pattern. However, there are ways to integrate MVC with MFC.


MVC is to desktop widget libraries like the ISO OSI model is to the internet protocols. It just does not fit because it is too rigid.

I don't think a single pattern exists that describes MFC (or desktop GUI programming in general) well. Maybe the hierarchical Model-View-Presenter is a good approximation.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜