Showing posts with label MFC. Show all posts
Showing posts with label MFC. Show all posts

MFC and Design Patterns

I found this article very interesting which talks about the design patterns in MFC. Its exhaustive, detailed and is an interesting read.

The singleton pattern could well have been used in implementing CWinApp objects, which represent the application and should not be instantiated more
than once. MFC relies on the programmer to define only one static instance of a
subclass of CWinApp.



An SDI(Single Document Interface) can have multiple views which is demonstrated in this Microsoft example. A Document can have multiple views associated with it, UpdateAllViews() method is called from document to update all its views. But a View is always associated with a single document. SDI and MDI are different in terms of single or multiple documents and not views.

This article in code guru, explains the steps in creating an SDI with multiple views.