views:

115

answers:

2

When I am developing a bunch of designers/tools, what are some of the best fit patterns that go with a VSX Package and/or VSX Isolated Shell Package?

Any samples, links would be great.

+1  A: 

If you're looking for general design patterns, I would suggest looking into the Presentation Model pattern (also known as MVP and MVVM) for writing a custom designer.

In general, all VSPackages (regardless of the kind of tool) use the Service Locator pattern (i.e. IServiceProvider) for communicating with the IDE and other VSPackages.

Aaron Marten
Thanks I use both MVVM for Designer and SL pattern for any other services, just like you mentioned :)
Vin
+1  A: 

Apart from IoC and DI (Service Locator) where I on larger packages "replace" the IServiceProvider with Castle (Search for Castle Project) for my own services ect. and then MVP/MVC or just PresentationModel.

I Tend to use a Command Pattern for binding Menu items defined in the vsct file.

Besides that I Use whatever pattern or practice I see fit as I would in a regular .NET solution, factories, builders, observer, and so on.

I Also tend to use Aspect oriented programming for exception policies among other cross cutting concerns (see PostSharp)

Jens
Thanks for the PostSharp link. Do you have a sample of blog post on how you implemented Command pattern for menu items in VSCT file?
Vin
I Actually didn't, but I have tried to brew it down to the basics in this post now: http://www.dotjem.com/archive/2009/08/19/27.aspx
Jens