Is it possible?

Jun 10, 2008 at 2:29 PM
Is it possible to take advantage of what MAF has to offer, without rewriting the framework?

Version Resilience, Isolation etc...
Jun 10, 2008 at 4:23 PM
I only discovered MAF last night but often wondered the same thing, then I started reading up on MAF got tired and went to sleep, lol. If I get a chance I'll have a look and see what I can do about creating a sample. If you do manage to create a sample app let us know.

-Brett
Jun 10, 2008 at 5:24 PM
Dumb question...what's MAF?
Jun 10, 2008 at 5:43 PM
MAF is the Managed Add-in Framework, this is found in .NET 3.5 in System.Addin.dll. From what I've learned so far it is a form of a pluggable architecture that has concerns similar to Prism but also has concerns about security and module containment. It's more than just dependency injection and resource location, it's more of a contract and proxy based implementation where modules are running in an isolation boundary, they can be unloaded and replaced at runtime.

I need to learn a bit more about it and of course how to use it, though I think there is a definite difference in concerns between  Prism and MAF, even though they might sound similar on the bookshelf.

Check out the add-in blog.

I hope I didn't confuse you further,
-Brett
Jun 10, 2008 at 8:28 PM


brettryan wrote:
MAF is the Managed Add-in Framework, this is found in .NET 3.5 in System.Addin.dll. From what I've learned so far it is a form of a pluggable architecture that has concerns similar to Prism but also has concerns about security and module containment. It's more than just dependency injection and resource location, it's more of a contract and proxy based implementation where modules are running in an isolation boundary, they can be unloaded and replaced at runtime.

I need to learn a bit more about it and of course how to use it, though I think there is a definite difference in concerns between  Prism and MAF, even though they might sound similar on the bookshelf.

Check out the add-in blog.

I hope I didn't confuse you further,
-Brett


Thanks for yor responce.

There are many aspects to MAF. Using MAF to load the Add-ins should be possible (not much benifit in of its self). To get the full benift you need to load Add-ins into seperate AppDomains, and use an IContract derived interface to describe your "Framework API", in this case Prism. Is this possible using Prism? Would the benifit of starting with the Prism codebase be lost?
Jun 11, 2008 at 6:02 AM
Edited Jun 11, 2008 at 6:03 AM
Using Prism is not mutually exclusive with using MAF, and we have several members of our Prism advisory board that are planning to use both. Prism uses an IModuleLoader and IModuleEnumerator for performing it's discovery and loading of modules. For a MAF implementation you will most likely replace one or both of these services with MAF specific versions that will load the modules into the correct app domains using MAF.

One challenge around using MAF is in regards to how contracts are declared. MAF requires you to specifically expose everything you want to pass across the wire via a set of contracts (http://msdn.microsoft.com/en-us/library/bb384205.aspx). This is different than the way we customarily access services in a non-MAF world, which is by simply injecting them in the constructor.  There are other ways with MAF to expose types (services) without being as explicit, though there is not alot out there documenting this approach.

Glenn
Jun 12, 2008 at 6:48 PM
Using Prism is not mutually exclusive with using MAF, and we have several members of our Prism advisory board that are planning to use both. 

Is it likely that the combination of Prism & MAF be made public, or at least a white paper on how to go about it.
Jun 12, 2008 at 9:05 PM

The design of Prism seems to lend itself better to integrating MAF than SmartClient. Is this a true statement?

Would refactoring SmartClient CAB SCSF to use MAF, mean basically a re-write?

Or if we want to make full use of MAF are we better writing our own Application Framework, but still making use of the design patterns demonstrated in Prism?

To load Add-ins using MAF is one thing, to implement the full pipeline is quite another.

Jun 17, 2008 at 5:49 PM
Here's yet another acronym and framework to throw into the mix: Does MAF have anything to do with MEF (http://code.msdn.microsoft.com/mef)? Would Prism (or developers utilizing Prism) have any use for it? Just wondering... I have no experience with either one of these Managed [whatever] Frameworks.
Jun 17, 2008 at 11:01 PM
Not another one :(

It looks like some sort of module locator and dependancy injection framework where dependancies are exposed by attributes instead of explicit interface contracts.

-Brett


Jun 20, 2008 at 7:31 AM
MEF is actually different. MAF's focus is around versioning and app-domain isolation. MEF is focused purely on extensibility and using composition as an extensibility mechanism. As to the attributes, they are one way to use MEF. There are other was to use MEF that are are non-attribute based.
Jun 20, 2008 at 7:36 AM
Edited Jun 20, 2008 at 7:37 AM
ID10T Prism could absolutely use MEF. At the Composite Application Library level, you would need to implement an IContainerFacade to MEF's  CompositionContainer. You would also need to create a custom ModuleLoader and override CreateModule to use MEF's facilities. If you ported over the RI itself, you would need to change wherever we register with the container, to register using MEF.

I am planning to do a port of Prism with MEF. In a few weeks I am heading over to the MEF team as a new PM. ;)

Regards
Glenn
Jun 20, 2008 at 8:16 AM
Thanks Glenn

Can you tell us what the goals of Composite WPF and MEF are? I still haven't found time to get into MEF just yet but do want to introduce it to my sample. I'm finding the lines blured between MEF and Composite WPF with regards to responsibility and what they are both trying to acheive.

From what I've gathered from the MEF samples, anything that MEF addresses can be done with Composite WPF, though I haven't verified the reverse.

So will you still be working with Composite WPF or exclusively on MEF?

-Brett
Jun 21, 2008 at 4:45 AM
Hi Brett

MEF and Prism are two very different animals. You can think of MEF relating to Prism similar to the way you think about Unity relating to Prism. MEF would be used for discovering and composing dependencies, i.e. it provides the extensbility hooks and plumbing. Prism adds a whole bunch of services that can live in a container such as MEF, and then are injected to support composite application scenarios.

When I get to the MEF team, I'll be focused completely on MEF. However, I'll still be in close contact with the Prism team, and doing plenty of Prism blog post, talks, etc.

Glenn
Jun 21, 2008 at 11:21 PM
Thanks for the update Glenn, I'll certainly be keeping an eye on your blog.

-Brett
Jul 18, 2008 at 6:52 AM
Edited Aug 8, 2008 at 5:17 AM

Hi Glenn,

Thanks for the details you provided in this thread but still I want some more details on "Integration Capabilities of Prism with MAF and MEF" and "How to integrate code developed in MFC/C++ (Winforms) in to Prism(WPF) ?"

- Harry

Sep 9, 2008 at 3:07 PM
Hi all,
could please someone explain what are the key points that differ CompositeWPF from MAF (CLR Add-in) and vice-versa?
We could use together or take advantage from one in the other?

We need to start an enterprise composite desktop application in WPF, and we don't want to miss anything around here.

Thank you very much

- Riccardo
Sep 9, 2008 at 3:44 PM

Hi,

We also need to integrate MFC/C++ code and have been evaluating MFCAdapter (
http://www.codeproject.com/KB/mcpp/MfcAppContainer.aspx). Our wonderful IT department blocks the main website.

We see MAF only solving some of the low level problems that we are facing, where as the CompositeWPF provides higher level building blocks. The main feature of MAF that is important to us is version resilience. With CompositeWPF all the modules are version locked with the application (host). For us a group of modules make up a product and we want the host to be able to load multiple products, without forcing the user to upgrade all the products each time a new version is released.

Kent Boogaart has an excellent blog dealing with MAF and composite applications.

See MAF Gymnastics.

http://kentb.blogspot.com/search/label/System.AddIn

Thanks,

John

Sep 9, 2008 at 4:16 PM
John, why are you saying CompositeWPF isn't version resilience?
If you design all with interfaces and let consume each module services of other modules or of the shell by contracts, only if you break the compatibility in these interfaces you need to upgrade all the products.
Probably I miss something in your scenario.

- Riccardo
Sep 9, 2008 at 5:00 PM
We want to be able to change the interfaces or behaviour without requiring all the products to be upgraded, yet be hosted in the same application and allow the products to interact with each other.

John