This project is read-only.

MEF Enabled Web

Nov 13, 2008 at 2:19 AM
Edited Nov 13, 2008 at 2:24 AM
Continuing from a thread in the MEF forum in response to "Ok gents! My samples have been checked in!"

First and foremost - great job on the samples!  I think they'll be a great start for those looking to MEF'ify their Web applications. 

I think it would be appropriate for us to give credit where credit is due in regards to the MEF.Web project.  I was glad to see you implemented Chris and Michael's Proof of Concept - you did a great job on it.   A reference in your documentation section to their work would be a great start in helping developers understand how the "Mef enabled web" application utilizes the Global.asax and httpModule (configured in Web.Config) to compose the controls.   Those not familiar with httpModule will be lost...

Question:  Are you okay with me checking in the refactoring work I did to incorporate your solution into the MEFContrib solution?

I did some minor refactoring so that all of the projects are under the MEFContrib.sln (versus requiring them to load a second solution to gain access to the MEF Web Application projects).  Note: the download, as is, won't compile without resolving references (minor stuff) but we can use this opportunity to provide developers a product that compiles and runs without issue.  

I'm not sure if it was the refactoring that caused the break but I had to point the "Web Extension 1" project's build path to the "Mef enabled web" so that the LoremIpsumUserControl2.ascx had it's code behind files; I adopted this method from the SCSF so that the developer(s) don't have to remember (or know) to copy .DLLs after updates.   We'll probably want to rename the project OR assembly name so that they're consistent, e.g., name the project MEF.Extension1 so that when they see the .DLL in the bin folder they'll know what project created it.

Thanks again Henric - it is a great contribution!
Nov 13, 2008 at 7:24 AM
Ah, actually I did the "MEF Web made simple" projects and Magnus did the other http module based projects, so I guess most of your questions/statements refers to his work.
Anyway, regarding my contributions you are definetly welcome to refactor in any way you like. I am happy to have contributed!
Nov 13, 2008 at 8:44 AM
Bill, Henrik - absolutely no problem at all! True the original MEF Enabled Web was my sample proof of concept thingie. But it is out there for anyone to use and/or modify. Your simple version to solve one isolated small requirement on one page is to the point and exact. It is cool to have a more general, yet rudimentary, version and a mini version targeted at diffrent problems. Don't worry too much about who did what - the important thing is that we are all in here and make changes as we see fit and useful to make the picture of

I followed, as you pointed out, a proof of concept from Chris and Michael to get the MEF enabled web up and running. As you surely know there is a bit of a vaccuum on the web composability front? There hasn't been a new release of websf bits since february and as far as I can tell there is no active work on that front right now. What I resorted to was the use of updated backend bits and proof of concepts for the new front end bits that are currently not there. This means that there are perhaps several parts of MEF Enabled Web that needs further explanation and discussion. Certainly there are things in my relatively quick sample that may be constructed in a myriad of other ways - many of which may indeed be better than mine!

So by all  means hack away at it and incorporate it into the same set of samples as the rest! I agree that downloading the code from this contrib should be easy to just open and run with all samples present in the same solution!