views:

49

answers:

1

How is view management and selection typically accomplished in a desktop app? I know the FrontController is a popular pattern in web apps but I have the feeling that it is not well suited for desktop applications since selecting pages is easier than selecting nested child views for instance.

Would my main app view need to know about all child views and decide what views to show based on application events? Would I implement sub MVC/MVP for the sub components?

A: 

In the WinForm apps I've been working on we utilize MVP for the individual views (UserControls usually). The Main form (and typically some sub-forms) utilize surfaces that can display UserControls (In CAB these are called Workspaces, and in my own apps I've just rolled my own versions of these).

The Workspaces get added to a collection at runtime. So do the views. So then anywhere you need to perform "showing" logic, you can do it easily with a line of code, like this:

Workspaces[WorkspaceNames.MainWorkspace].Show(Views[ViewNames.EditEmployeeView]);
Chris Holmes