What are best fit patterns to use when developing VSX Package or Isolated Shell Package?

StackOverflow https://stackoverflow.com/questions/197589

  •  10-07-2019
  •  | 
  •  

Question

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.

Was it helpful?

Solution

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.

OTHER TIPS

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)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top