Web Log di Adrian Florea

"You know you've achieved perfection in design, not when you have nothing more to add, but when you have nothing more to take away." Antoine de Saint-Exupery
posts - 440, comments - 2715, trackbacks - 3944

My Links


Post Categories

Image Galleries

.RO Blogs

.RO People

.RO Sites





MVC versus Document/View in MFC

Sto leggendo il bellissimo libro di Dino & Andrea, "Microsoft .NET: Architecting Applications for the Enterprise" e mi ha incuriosito questa loro osservazione alla pagina 362: "[...] Microsoft Foundation Classes (MFC) offered more than a decade ago an architecture with some points in common with MVC - particularly, the Document/View (DV) model. DV can be seen as a version of MVC where the view and controller are fused together. We really don't know whether the MFC team intentionally discarded MVC to embrace DV; our feeling, however, is that DV blossomed autonomously during the design by simply applying correctly and diffusely the SoC principle".

Sembra che alla PDC del 1995, un membro del team di MFC abbia raccontato proprio la storia del "MVC versus DV" nella scelta architetturale di MFC: "[...] for the controller’s message mapping mechanism, can’t we just reuse MFC’s message map solution? Ideally, yes. But there is one big problem here... A separate controller class for message handlers may sound like a good idea, but MFC was designed in such a way that this was thought impossible. MFC allows commands such as menu picks to be rerouted to non-windows, but not windows messages such as mouse clicks. In MFC, only a CWnd can receive windows messages and only one instance of a CWnd can receive the messages for a real Windows window. Since a controller is meant to be a non-window that can handle windows messages and exist in multiple instances per window, we seem to be stuck! An interesting aside, this problem was sited by an original MFC team member as the main reason Microsoft emulated MVC for the CDocument and CView, but stopped short of implementing a controller (MFC Professional Developers Conference, 1995)". Interessante...

Print | posted on sabato 4 aprile 2009 00:18 | Filed Under [ Un po' di storia Pattern Dappertutto GUISA ]

Powered by:
Powered By Subtext Powered By ASP.NET