views:

290

answers:

6

This question is similar to

  1. What is the most common design patterns for any windows forms application?
  2. UI Design Pattern for Windows Forms (like MVVM for WPF).

But I would like to ask something more specific: I want to know what design patterns Microsoft use to built their impressive array of desktop apps suites, including VS 2008, Microsoft Office and so on.

Anyone has any ideas? I look around but I can only find vague details, at most. There doesn't seem to be a lot of information out there on this.

Edit:OK, maybe I would relax the question a little bit: Anyone knows how any major software producers ( not just Microsoft) build their desktop application?

A: 

I do not think that there is a set of design patterns that all windows (or even most) desktop applications will (or should) use.

Although some patterns that are heavily used in server applications may not be as common, the usage of design patterns comes back to the intended usage of each individual program.

chills42
Most common design patterns will be the most commonly used desktop applications-- that's not a helpful answer.
Ngu Soon Hui
Sorry, I think the wording might be a little vague, I'll try to clarify.
chills42
A: 

Well, in my humble experience, I've seen and used something called PAC :

Presentation - Abstraction - Control

The two main ideas are :

  • To decorrelate the Presentation (ui rendering / user events) from the abstraction (your processing : data access, object model, hardware, IO, ...) by using a controller that manage the link between those two parts.
  • To manage a hierarchical tree of agents where an agent is a Presentation module, an Abstraction module and the controller module.

In concrete implementation, Presentation modules translate low level UI event to application events, the controller manage the flow of events to the higher level. Some events go to some manager that dispatch them to the processing part of the application (Abstraction).

This way :

  • The UI part is cleanly separated from the processing / abstraction part. You can change the UI, use a GUI and a text UI, a TCP/IP command UI, ...
  • The hierachical organisation of UI agents maps to your UI elements which you can reuse in many different applications.

Of course a lot of others patterns are use but this main architecture is the key for reusing UI modules and of course processing/business modules.

EDIT:

I've retrieved a great article on UI architecture comparing different kind of architecture, including PAC :

a must read for UI/application architect

neuro
A: 

On Mac OS X, the design of the Cocoa web framework strongly emphasizes the use of the model-view-controller approach. I would imagine Apple likely used MVC when building most of its apps, and most Mac developers seem to use the same approach. Hard to say for sure, though, since I don't have access to the source code for most of Apple's applications.

mipadi
A: 

The design patterns found in the Gang of Four book all came from examining real-world software applications and seeing what common solutions were used. I would guess that the patterns presented in the book were also generalized to be more useful to a general population.

Given that fact, I would expect that any medium or large scale application would contain at least a few patterns or variations on patterns described by the Gang of Four.

Thomas Owens
+1  A: 

For Windows Form application I suggest that you try out the Composite UI Application Block (CAB) for which you can find a lot of information at the MS Site in Patterns & Practices. I did not us it myself, since I'm mostly developing web application, but I have some collegues who have been using it and who realy recommend it. More information here and at codeplex:

If you are aiming for a WPF application, CAB is not so good. You'd better look at what's called PRISM. I could explain you why PRISM is better than CAB in case of WPF applications, but there's already a very good explanation on the internet which you can find here and also at codeplex:

Both 'solutions' are created by the Microsoft Patterns & Practices Team and can be found at CodePlex... so I think it's a good way to go !

DiVer
Sadly, CAB seems to be a dead project.. there are a lot of bugs with it, and it just doesn't seem to work as well as many would like. They seem to be puttin gall their effort into WPF/Silverlight, and frankly, for those of us with a lot of knowledge of Winforms, we'd rather continue using Winforms for a while before starting projects with these newish technologies.
Mystere Man
+1  A: 

You may want to check an interesting article by Rob Pierry,

Discover the Design Patterns You're Already Using in the .NET Framework in MSDN Magazine

It may help realizing that some of the patterns such as Iterator, Observer, Decorator, Adapter, Strategy, factory, etc... is used almost everyday while programming in .net

Sun