views:

281

answers:

3

I want to separate concerns here. Create and embed all the UI logic for the Custom XML designer, object model, validations etc in to a separate assembly. Then the Package framework should only register the designer information and ask for a UI Service and everything works magically.

This way I don't need to play with the Package framework (Visual Studio Package) assembly, when I need to modify the UI designer.

This question also applies to anything where you have to separate the UI logic from the Skeleton framework that loads it up, like a plugin.

I have several choices a ServiceProvider model, a plugin model or may be other.

Any samples, suggestions for patterns, links are welcome.

Update 1: What I am looking for is a thought such as - "Does Prism (Composite WPF) fit the bill? Has anyone worked on a project/application which does the separation of concerns just like I mentioned above? etc" (I am still looking out for answers)

+1  A: 

What you're asking about seams very much like the separation of concerns that the MVC pattern tries to enforce.

ASP.NET MVC is already out there with a preview 5.

It's mainly for web but I think they are planning on using it also for WinForms, but I'm not sure.

Gustavo Carreno
Thanks for pointing out, but I was looking for more precise suggestions/samples of having this done in relation to VSX package.
Vin
+1  A: 

I've created a VSPackage that loads an editor. The Editor sits in a separate assembly and implements an interface that I defined. The VSPackage works with the interface, so any changes I make to the editor (and its assembly) does not affect the VSPackage as long as I don't change the interface.

Rotem
Yes that's what I ended up doing. We also created a PackageSupport project that has these interfaces and common VS related logic and it's handy.
Vin
A: 

Hi Vin

I prefer the Model View Presenter pattern

Regards Muse VSExtensions

Muse VSExtensions