Managed Extensibility Framework

Several months ago we formed what we call Application Framework Core team. The charter of the team is to play the same role in the application frameworks space (WinForms, ASP.NET, WPF, Silverlight) as the Base Class Libraries (BCL) team plays at the bottom of the platform stack.

The BCL team did a good job fulfilling the role of the team responsible for decreasing duplication and providing common abstractions for the low levels of the platform. Unfortunately, we did not have a similar team really focused on these sets of issues higher up on the stack. This resulted in some unfortunate duplication (like several data binding models for each of the application models, different dependency property system for WPF and WF) and lack of common abstractions (what undo APIs should my generic application plugin call?) for application model code. The Application Framework Core team is now in place to start addressing the problems.

One of the first concrete projects that we are working on and are ready to slowly talk about is what we call the Managed Extensibility Framework (MEF). We observed that there are more and more places in the .NET Framework itself and increasingly managed applications (like Visual Studio) where we want to provide, or already provide, hooks for 3rd party extensions. Think about TraceListener plugins for the TraceSource APIs, pluggable rules for Visual Studio Code Analysis (and the standalone FxCop), etc. In the absence of a built-in extensibility framework (like MEF), our developers who want to enable such extensions often are forced to create custom mechanisms, thus duplication. We hope that MEF will both stop such duplication and encourage/enable more extensibility in the Framework and applications built on top of it.

We will blog more details about MEF in the upcoming months, but here are some early details (subject to changes, of course): MEF is a set of features referred in the academic community and in the industry as a Naming and Activation Service (returns an object given a “name”), Dependency Injection (DI) framework, and a Structural Type System (duck typing). These technologies (and other like System.AddIn) together are intended to enable the world of what we call Open and Dynamic Applications, i.e. make it easier and cheaper to build extensible applications and extensions.

The work we are doing builds on several existing Microsoft technologies (like the Unity framework) and with feedback from the DI community. The relationship with the Unity team is the regular relationship between the P&P group and the .NET Framework group where we trickle successful technologies and ideas from the P&P team into the .NET Framework after they have passed the test of time. We have done this with some features in the diagnostics, exceptions, and UI space in the past. The direct engagement with the DI community is also starting. We gave a talk on the technology at last week’s MVP Summit, and talked with Jeremy Miller (the owner of Structure Map) and Ayende Rahien (Rhino Mocks) . We got lots of great feedback from Jeremy and Ayende and I think their experience in the DI space and their feedback will be invaluable as the project evolves. Thanks guys! We are of course also looking forward to engaging others in the DI community.

And finally here is some code showing basic scenarios our framework supports:

Creating an Extension Point in an Application:

public class HelloWorld {

 

  [Import] // import declares what a component needs

  public OutputDevice Output;

 

   public void SayIt() {

        Output.WriteLine("Hello World");

  }

}

 

// Extension Contract

public abstract class OutputDevice {

  void WriteLine(string output)

}

1.       Creating an Extension

[Export(typeof(OutputDevice))] // export declared what a component gives

public class CustomOutput : OutputDevice {

  public void WriteLine(string output) {

    Console.WriteLine(output);

  }

}

 

2.       Magic that makes composes (DIs) the application with the extensions.

var domain = new ComponentDomain();

var hello = new HelloWorld();

 

// of course this can be implicit

domain.AddComponent(hello);

domain.AddComponent(new CustomOutput());

 

domain.Bind(); // bind matches the needs to gives

hello.SayIt();

Expecting lots of questions, I will preemptively answer (J): we don’t yet know whether or when we will ship this. We do have working code and we are looking into releasing a preview/CTP of the technology. For now we would be very interested in high level feedback. What do you think hinders extensibility in frameworks and application? Where would you like the Framework to be more extensible? What DI framework features you need, like, want, and use on daily basis? i.e. is constructor injection required?

And lastly, we are hiring! :-)

Published 25 April 08 09:45 by kcwalina
Filed under:

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# ploeh said on April 25, 2008 6:28 PM:

Looking good - I've been waiting for such a thing to be available in the general framework for a long time :D

To answer one of your specific questions, I think constructor injection is very much required, and I explain why here: http://blogs.msdn.com/ploeh/archive/2007/06/02/StateYourDependencyIntent.aspx.

# Thomas Krause said on April 25, 2008 7:46 PM:

First of all constructor injection is a must for me also.

One thing that I don't like is that I have to clutter my classes with attributes to use your DI container.

You should at least have a way to make this optional.

My classes shouldn't depend in any way on the DI container used.

Take a look at how other DI containers handle this.

Also please provide good extensibility points to the DI container itself and make it easy to unit test.

If you want to do it right, take a look at how the ASP.NET MVC team has done it. Listen to the community, look at other projects in this domain, ship early and often, make it easy to test, extend or even replace.

If you keep this in mind, this could become useful.

Thanks.

# garethhayter said on April 26, 2008 1:17 AM:

Fantastic news. It is important that these extensions can be added and removed/replaced at runtime and also able to run at full performance. The current approach to making extensions unloadable by using separate AppDomains results in too much of a performance-hit if there is a lot to serialize across the AppDomain boundary.

I look forward to hearing more about this as you progress.

# Andrey Shchekin said on April 26, 2008 3:20 AM:

I think that constructor injection is absolutely necessary (I use Castle at the moment). If it is not available, I probably would not use MEF.

Overall, I am quite disappointed by the default public constructor requirement in a lot of places within framework (why can't all things like JSON serialization just use TypeConverter.CreateInstance).

It makes class much less maintainable, since there is not static way to check it got all dependencies.

# Oleg Sych said on April 26, 2008 10:16 AM:

Krzysztof,

From your prospective, what makes dependency injection better than some of the existing patterns (such as ProviderBase)?

How would adding attribute-based dependency injection affect usability of the .NET framework?

For example, one could argue that the following example is comparable in flexibility but easier to understand and debug.

<code><pre>

public class HelloWorld {

  public void SayIt() {

     Console.WriteLine("Hello World");

 }

}

// Service Contract

public static Console {

  private static TextWriter _out;

  public static void WriteLine(string s) {

     _out.WriteLine(s);

  }

  // Injection Point

  public static void SetOut(TextWriter out) {

     _out = out;

  }

}

// Provider Contract

public abstract class TextWriter {

  public virtual void WriteLine(string s);

}

// Concrete Provider

public class StringWriter : OutputDevice {

  private StringBuilder _sb;

  public override void WriteLine(string s) {

     _sp.Append(s);

  }

}

// There is no magic

Console.SetOut(new StringWriter());

var hello = new HelloWorld();

hello.SayIt();

</pre></code>

Although more verbose, with a simple code generation tool (perhaps based on T4), this example could be as easy to implement as the example with attribute-based dependency injection. What do you think?

Thanks.

# Van den Driessche Willy said on April 26, 2008 6:20 PM:

Personally this is not the kind of dependency injection I am looking for.  I am looking for a way to make HelloWorld and CustomOutput work together without any explicit code to bind them.

After all, if there is code like :

domain.AddComponent(hello);

domain.AddComponent(new CustomOutput());

Then why not simply

hello.Output = new customOutput()

The more interesting part would be for hello to <i>find</> the implementation CustomOutput.

As I mailed before we use attributes a lot to do this "binding" but more in the sense of <EditorFor> <ValidatorFor>.  The semantics of the "extension" then deal with the fact that we have 0, 1 or more classes that apply for this case.

But maybe I'm missing something ?

# Corrado Cavalli said on April 27, 2008 10:52 AM:

I saw Kit's demo at recent MVP summit and was great but, how does this fit with System.AddIn?

# Mike Taulty's Blog said on April 27, 2008 3:46 PM:

Very interesting post over here.

# Curt Hagenlocher said on April 27, 2008 7:47 PM:

Please don't forget code implemented in DLR-based languages, which often can't use attributes, provide constructors or be loaded directly from an assembly.  The most generic way to supply an object-creation function is through a delegate.

# Winston Johnston said on April 28, 2008 12:24 AM:

I think that Constructor Injection is absolutely required because it allows you to strictly define the object dependencies and abstracts you from a particular DI system. I can therefore write a class that will support DI with CastleWindors, Unity etc. Use of attributes should be a last resort.

Also, why reinvent the pattern?

IUnityContainer container = new UnityContainer();

container.RegisterType<CustomOutput>();

var hello = container.Resolve<HelloWorld>();

hello.SayIt();

# Raymond Roestenburg said on April 28, 2008 9:56 AM:

Here is my wishlist :)

Total transparancy is number one for me. I should be able to use existing code with a DI framework, no recompile or change needed.

This includes existing .NET framework code. So I would at least need transparent constructor and property injection, and a way to assign factory objects through a delegate/method, specify singleton. transparent also means that it should work with all the different hosts like ASP.NET, ClickOnce, NT Services, etc.

Anything else simply won't do.

What also needs to be totally transparent is the errors you inevitably make in configuring the DI framework. Nothing worse than going through attributes or xml config to finally find a typo somewhere because the stacktrace gives you too little info. You need proper exception handling with human readable description of the reason why it doesnt work.

The configuration should be validatable/checked for errors before running your application to limit this happening, hooking this into compilation of code would be great.

Configuration should be possible through XML and programmatic interface. (Configuration should obviously be extensible and replaceable with other implementations)

As for programmatic interface I would like two flavours, standard .NET (inside the executing program) and DSL scripting interface (outside of the executing program, comparable to XML configuration) for instance a DLR language or a less verbose CLR language like boo.

In my opinion a framework is partly as good as the tools it comes with.

The configuration should have an 'editor' of sorts in Visual Studio, (checkout spring ide, its got some nice features on the java side). Even better would be if you could configure and connect the objects you want through some kind of class browser and select your output for configuration. the better you get this part down, the easier it will be to adopt.

Other than that I would like lifecycle management, hooks for creation and cleanup, a facility like extension model like Windsor Castle has, custom XML schema extensions like spring and

an easy way to provide plugins through DI and the  possibility to assign separate Appdomains for the plugins would be great as well.

# Patrik said on April 28, 2008 11:11 AM:

This seems very cool, but I have concerns regarding usability. How is it intended to be used in larger projects?

# Magnus Mårtensson said on April 28, 2008 1:07 PM:

I don't mind Constructor Injection but I've always preferred Property (Setter) Injection or eve Method Injection but that's because I like to drive the design I make using my interfaces - which makes .ctor injected dependencies 'invisible' to me. Not saying you should ban CI - not at all! I just wanted to voice the opposite opinion in this torrent of praise for this one type of injection. ;~) That's my €0.02.

# joewood said on April 28, 2008 1:34 PM:

We use our own IoC/DI framework.  

I think standardizing on the (optional) attributes is a good thing.  This way other frameworks can use these same attributes.

Not sure about the .Bind() idea - binding consumers and providers of services is often much more complicated than the 1:1 relationship that this implies.

Also, DI is all about the configuration.  What about setting properties using reflection?  What about a standard container?  or container interface?

# WillSmith said on April 28, 2008 1:57 PM:

When I have used/looked at XAML and the XAML Loader, it occured to me that you basically have and very very flexibile system to create object trees of any kind a runtime.  I would like to see Unity be built on top of the XAML infrastructure that we are already learning.  The inheritance features for properties are just one very powerful feature that could be exploited for DI.

# Ran Davidovitz said on April 28, 2008 4:34 PM:

Invent, invent, invent :(

1. Why not simple reuse of other framework like Unity / Spring?

2. Dont forget about configurable (as opposed to programmable)

3. I read it and wansn't amazed, everything was already done by other framework - did i miss anything?

# kcwalina said on April 28, 2008 5:45 PM:

Corrado, we would like MEF to be a composition engine for plain CLR object, COM components (wrapped in RCWs), and System.AddIn components. In other word, we are looking into being complementary to System.AddIn.

# kcwalina said on April 28, 2008 5:48 PM:

Thanks for all the great feedback. It will really help us weigh the pros and cons of the two main design issues: constructor injection and the attribute based programming model.

We have had many discussion about these two internally, and there are interesting tradeoff we would need to make to add these two features. I will try to erite about the tradeoffs (or ask somebody on the team to do it) to start a focused discussion about these two.

Thanks again for the feedback. It's all great!

# kcwalina said on April 28, 2008 5:58 PM:

Ran,

We want to use it for extensibility of the Framework itself and Visual Studio. We cannot use Unity or Spring for this.

# Stuart Carnie said on April 28, 2008 6:03 PM:

@Oleg

My biggest issue with this is I expect Console.WriteLine to write to the Console, not some other stream (unless the console is being redirected to a file, which is standard behaviour).  OutputDevice only implies the input will go to some device.  Could be the console, a printer, a network stream, etc...

@Krzysztof

Performance is critical.

I'd also like to see the attributes in a non-specific namespace, so other DI frameworks could use the same metadata.  Ideally this would be general enough for any DI and/or IoC framework to consume.  In the past, I have had mixed feelings about using attributes within one's code for the DI / IoC framework; however, I now believe it to be necessary.  Why?  Primarily from a discoverability point of view - I want to be able to use a generic tool to examine an assembly and identify the dependencies.  Configuration is great, but it is very difficult to determine the original engineer's intent without the attributes.  From your example above, it is easy for me to see (given the presence of the [Import] attribute) that the Output property should be injected / provided externally.  Without the attribute (and being purely configuration based) how do I know this?  I now have to look elsewhere, making experimentation difficult.

Cheers,

Stuart Carnie

# Scott Hanselman said on April 29, 2008 1:19 AM:

Personally, I'd REALLY this to look more like structured typing. I'm pretty much over Attributes and would prefer a way to do DI without Attributes.

# Kevin Lam said on April 29, 2008 2:21 AM:

Sounds awesome!  I've had to duplicate lots of effort from project to project that requires extensibility of some sort and so can't wait to see what you and the rest of the team cook up.  

Thanks,

Kevin

Impacta LLC (http://www.impactalabs.com)

# Hammad Rajjoub said on April 29, 2008 3:38 AM:

constructor Injection --> a big YES

attributes based mechanism --> a big NO

# Mohamed A. Meligy said on April 29, 2008 3:56 AM:

Sounds very promising in general, but ...

What I still don't get here actually is:

What do we have here in addition to using Unity with System.AddIn?

Can you put together more explanation about this please? i think it's a FAQ too :).

# John Sinnott said on April 29, 2008 5:30 AM:

Re: Spring.Net as a way of getting where you are trying to go.  

Perhaps you should think of Spring.Net as going to far in terms of complexity and performance hit - and trying for a target well inside that extreme.  

Also, why the "bind"?  Unless you are trying for a lazy injection or have order of injection issues, it would be great to avoid the "bind" entirely.  

# Gökhan said on April 29, 2008 6:49 AM:

What will my options be when dealing with components / libraries? Shall I have to dig reflector / documentation to see if it accepts injection through [Import] attributes? What if the original developer is a DI noob but I still want to use his/her code through injection where it fits?

I prefer getting rid of [Import] at least, and finding a way to bind [Export] (or getting rid of it as well, preferred) to ctor's, properties and fields. And like many others, I'm quite satisfied with the way other DI frameworks work (Windsor, StructureMap, Spring etc.). If I'll have the option of external configuration over attributes, I'll always prefer external configuration.

Thanks for the open discussion, between.

# Adam said on April 29, 2008 1:51 PM:

I'll throw a vote in for Compact Framework support in the initial release, but that's probably wishful thinking.

# Stuart Carnie said on April 29, 2008 3:20 PM:

External configuration is great, but I have a couple of problems with it being the only source of information about the dependencies.

1. It's typically too specific to the framework and I as a consumer have to understand the configuration before being able determine the dependencies.  This makes simple exploration more difficult.

2. Configuration is separate from the assembly which has the dependencies, therefore without it, I have no way to determine what those dependencies are.

Why not have simple attributes that at least identify the original developer's intent?  Certainly configuration can be used in conjunction with this metadata to define who is providing an implementation for the dependencies.

I feel another issue with external configuration is reuse.  It is okay if you are building one application host to run your component based application / architecture.  Developer's can examine the associated configuration and find the extension points and extend your existing application.  The problems arise when I want to write (as an example) a console application that reuses some of your framework.  It's quite difficult to find all the dependencies.  This comes from personal experience in architecting an enterprise level commercial application using DI / IoC (ObjectBuilder / CAB) and subsequently writing a lot of these 'console' apps to reuse framework functionality.

With some simple attributes on the classes to declare that this is an extension point, you now provide some discoverability.

Say we have this class:

class HelloWorld {

 public OutputDevice Output;

 public void SayIt() {

   Output.WriteLine("Hello World!");

 }

}

Looking at that code, I have no idea the Output is an external dependency...  Equally, if I only have binaries, reflector won't help either.

With [Import], I have some guidance.  Another side effect is much better tool support.  As an example, intellisense would be able to show a visual cue that Output depends on OutputDevice.  Furthermore, code-analysis could show any classes I consume that have external dependencies.  Attributes not only enable discoverability but better tool / code-analysis support.  Reflector could also benefit from the attribute metadata.

I think that Import should have one optional parameter, Required(bool), so we can declare that if the service is not available when binding, building or resolving, to throw a some sort of DependencyNotFoundException.

# Mark said on April 29, 2008 6:01 PM:

I will have to agree with the other commenters who want constructor injection.  Initially Attributes were appealing and in many cases I still use them but for DI related functionality I much perfer constructor injection.  Please do not bake in a dependency on attributes for this scenerio.

# DotNetKicks.com said on April 30, 2008 3:23 PM:

You've been kicked (a good thing) - Trackback from DotNetKicks.com

# kcwalina said on April 30, 2008 8:55 PM:

OK, so based on the feedback, we just spent several hours talking about constructor injection and the attributes at our team’s design meeting. I will try to post more details on my blog, probably early next week, but MEF is architected to support POC types (plain old CLR types). The samples use attributes, but the same metadata can be theoretically provided externally. For example, form a configuration file. To be completely clear, this is what MEF’s architecture allows, not what we currently support/test or what is easy to do. At the team’s meeting we decided to put it on the list of high priority scenarios to investigate.

Constructor injection is harder. It would fundamentally change the architecture of MEF. This might take some more time to settle on. I will of course also describe the main tradeoffs here in the next couple of weeks.

# Brad Abrams said on May 1, 2008 12:46 AM:

The single biggest factor for success on any project I have been apart of in the last 10 years at Microsoft

# Steve Degosserie said on May 1, 2008 7:29 PM:

Explicit model of Dependency Injection is still preferable in most cases I guess ... implicit model can have some problems:

- Which implementation does the container have to inject for a dependency if there are several implementations of OutputDevice registered ? first one that was registered ?

- What if the component has several properties of the same type and several implementations are available in the container? Which implementation do we inject for which property?

Those are edge-cases ... but well, 'you never know what you'll get'.

I also don't like the invasion of my components by attributes (where's the loose coupling of IoC?). External configuration is acceptable although we then miss expressiveness of code.

Explicit registration of dependencies on the 'ComponentDomain' might be interesting ... using lambda expressions, it can give something like:

domain.RegisterDependency<HelloWorld, OutputDevice>((h, od) => h.Output = od);

or, if I want to specify a particular implementation, declare the dependency directly to that type:

domain.RegisterDependency<HelloWorld, CustomOutput>((h, od) => h.Output = od);

with RegisterDependency method declared as:

void RegisterDependency<C, D>(Action<C, D> dependencyInjection) where C : class where D : class {}

# tivan said on May 2, 2008 6:33 AM:

微软建立了一个应用程序框架核心(ApplicationFramework

Core)团队,以减少WCF、WPF以及ASP.NET之间的重复。这个团队的目标是为了避免一些设计上的问题,例如WPF与W...

# Edward J. Stembler said on May 4, 2008 4:04 PM:

Personally, I feel you should create a (DI) Container Provider, and then provide a concrete Unity implementation.

Microsoft.Mef.Container

Microsoft.Met.Container.Unity

Others can create their own concrete implementations too (i.e. Spring etc.).

Microsoft.Mef.Container.Spring

This is exactly what I did when I customized Prism for my needs.  And by Provider I mean the one which inherits from ProviderBase, and is specified in a corresponding config section.  Not the loose interpertation of the term as Prism currently implements.

# Glenn Block said on May 12, 2008 2:20 AM:

Attributes = No, Autowiring = Yes

# Eduardo Jezierski said on May 12, 2008 2:51 AM:

I expect all of these maps of dependencies and contributions to be fully dynamic right? Attributes are fun for the demo and simpler apps but are severely limiting for many scenarios.

Id like to see evidence of thinking of contributions and dependencies in  beyond object references... e.g. event hookups, etc etc.

Good luck and keep up the good work~!

# GarethJ's WebLog said on May 14, 2008 12:34 AM:

Just lately there seems to be a veritable feast of new blog stuff about VSX (if you don't mind me switching

# Steve Degosserie said on May 14, 2008 7:29 AM:

What do you guys think about dynamic activation / deactivation of components coupled with a concept of mandatory / optional extension points:

static void Main(string[] args)

{

   var domain = new ComponentDomain();

   var hello = new HelloWorld();

   // of course this can be implicit

   domain.AddComponent(hello);

   domain.AddComponent<OutputDevice>(new CustomOutput());

   domain.AddComponent<MessageProcessor>(new TruncateProcessor(2));

   domain.Bind();           // bind matches the needs to gives

   hello.SayIt("Hello");    // => "He"

   domain.DisableComponent<MessageProcessor>();

   hello.SayIt("Hello");    // => "Hello"

   domain.EnableComponent<MessageProcessor>();

   hello.SayIt("Hello");    // => "He"

}

[Extensible]

public class HelloWorld

{

   [ExtensionPoint(typeof(OutputDevice),

       ExtensionPointImportance.RequiredExtension)]

   public OutputDevice Output;

   [ExtensionPoint(typeof(OutputDevice),

       ExtensionPointImportance.OptionalExtension)]

   public MessageProcessor Processor;

   public void SayIt(string message)

   {

       string output = message;

       output = Processor.Process(output);  // Here some magic must happen internally if the extension was not provided or is not active :o/ lol

       Output.WriteLine(output);

   }

}

// Extension Contract

[ExtensionContract]

public abstract class OutputDevice

{

   public abstract void WriteLine(string output);

}

[ExtensionContract]

public abstract class MessageProcessor

{

   public abstract string Process(string input);

}

[Extension]

public class CustomOutput : OutputDevice

{

   public override void WriteLine(string output)

   {

       Console.WriteLine(output);

   }

}

[Extension]

public class TruncateProcessor : MessageProcessor

{

   private int truncateLength;

   public TruncateProcessor(int truncateLength)

   {

       this.truncateLength = truncateLength;

   }

   public override string Process(string input)

   {

       return input.Substring(0, truncateLength);

   }

}

Crazy idea ? :)

# joc77 said on May 14, 2008 10:58 AM:

Hierarchical domains : with SaaS getting more and more widespread will increase the need to have different options/components for different users. Users can be grouped into categories themselves grouped into organisational units or whatever tree structure you like. Il would be nice to be able to define a domain for the organisation unit, then inherit from the latter to define a domain for a category - with the possibility to override some of the options - and repeat the same pattern for particular users

# Joycode@Ab110.com said on May 19, 2008 1:45 AM:

【原文地址】 Managed Extensibility Framework 【原文发表日期】 28 April 08 06:14 Krzysztof 最近在他的blog上宣布 ,我们已经开始致力于为

# Programming said on June 1, 2008 6:42 AM:

Krzysztof recently announced on his blog that we have begun working on an extensibility framework for

# Dave's Box said on June 2, 2008 1:22 AM:

My name is David Kean and I&#39;m a software developer at Microsoft in Redmond. There I work on the Managed

# Dave's Box said on June 4, 2008 3:37 AM:

After accidentally losing my last personal domain and blog to an ‘advertising’ company that has now become

# Dave's Box said on June 4, 2008 8:46 PM:

I&rsquo;m pleased to announce that we&rsquo;ve just released a Community Technology Preview (CTP) of

# Aaron Marten said on June 5, 2008 12:18 AM:

Congratulations to the MEF (Managed Extensibility Framework) team who just released their first CTP!

# Wes' Puzzling Blog said on June 5, 2008 1:07 AM:

Today was a big day for my team because we released the bits for the first CTP of the Managed Extensibility

# Just code - Tamir Khason said on June 5, 2008 4:25 AM:

There is TechEd in Orlando, and this means, that there are a lot of new announcements. Let’s fill up

# Just Code - Tamir Khason said on June 5, 2008 4:25 AM:

There is TechEd in Orlando, and this means, that there are a lot of new announcements. Let’s fill up

# Mariano Vicario said on June 5, 2008 2:07 PM:

Wow....

I´m developing with my team a similar solution for mobile devices (.NETCF). But we have some differences. First we develop a really compact DI container.

In our case we have all the metadata in different xml's, each module has several XML's (similar to OSGi). This XML's of the module declare the inputs and outputs, of the module. The module also declares which inputs it needs, and we add a new concept that is the state of the input. Now each developer develops his module with the corresponding XML.

Now we are building an Application designer in which where the user select’s which modules will be include in the final application.

The designer checks all the dependencies are correct, and then we compile this xml in a CF dll, for performance issues (with codeDom). An then all dynamic injection is done in runtime between modules :).

It’s great this will be include in .NET Framework.! We will see the progress of this project. Count with us for testing, and comments form Argentina!

Regards,

Mariano Vicario

# Krzysztof Cwalina said on June 5, 2008 5:16 PM:

Several members of my team have already spilled the beans, but yes (!) we just released our first public

# Kirill Osenkov said on June 7, 2008 3:45 PM:

Krzysztof Cwalina announced that Microsoft has released a CTP of its Managed Extensibility Framework

# Eric said on June 10, 2008 12:47 PM:

Every time I see this, I cringe:

"POC types (plain old CLR types). "

No offense, but the fact you're using this terminology implies that everything new should somehow be "more complex".

The CLR/BCL/Framework was perfect in .NET 2, but quite frankly there are too many cooks in the kitchen right now and making a disaster of the beautify of .NET.

It's as though all the COM guys were retrained in C# and applying all the overly complicated nonsense and redundancy over what used to be a beautiful platform.

C# and .NET was great because it *DIDN'T* have things like this everywhere - the System namespace wasn't cluttered with 5 different ways of doing a single thing, it didn't have "extensions" or "System.Core" as kludges to work around arbitrary "red bits" rules.

I just ported some code from GDI+ into "WPF"'s imagine system and was appalled. Image processing classes tied to the network layer? Threading issues abstracted away and hidden from developers?

I'm really starting to think that .NET is completely rudderless and people are tossing as much crap as quickly as they can into it to justify their employment and Microsoft's new faster release cycles.

How does this framework provide *ANY* benefit other than additional complexity? For example, TraceListener classes were simple and easy to use. A basic, obvious design pa ttern.

If it was re-invented now, using this framework, it would be incredibly complex, require reflection, attributes, etc, etc - layers of unnecessary "crud" over the design of the API.

Even the use of "Import" and "Export" as attributes is proof that this hasn't been well thought out. Clearly those names have no semantic meaning anywhere elese!

# kcwalina said on June 10, 2008 8:15 PM:

Eric, I happy to engage in a discussion, as you might be pointing to good issues. The problem with the comment above is that it does not have enough concretes for me to respond, i.e. acknowledge or defend. For example, I did say that we are thinking about supporting POC, and so I don't understand how it implies that "everything new should somehow be more complex", why do you think that usage of attributes is a *proof* that it's not thought through, what are the 5 ways of doing the same thing in System namesapce?

# Minority blog said on June 11, 2008 2:54 PM:

public class HelloWorld { [Import] // import declares what a component needs public OutputDevice Output;

# Guru Stop said on June 17, 2008 11:23 AM:

· Everything You Wanted To Know About MVC and MVP But Were Afraid To Ask · Functional Programming in

# Glenn Block said on July 16, 2008 1:45 PM:

About three months ago, we were on the heels of shipping Prism (Composite Application Guidance). At that

# My Technobabble said on July 16, 2008 1:45 PM:

About three months ago, we were on the heels of shipping Prism (Composite Application Guidance). At that

# Community Blogs said on July 16, 2008 2:24 PM:

About three months ago, we were on the heels of shipping Prism (Composite Application Guidance). At that

# Winston said on July 17, 2008 12:43 AM:

Krzysztof, I have written a lot of classes that use constructor injection. I would ideally like a DI system that I can introduce with a minimum of code change. Why should my classes have a dependency on a particular DI system via Import/Export attributes?

# Andrew Stopford's Weblog said on July 17, 2008 7:39 AM:

While eating my lunch I was running through google reader and started reading a post from Glen , this

# kcwalina said on July 17, 2008 3:18 PM:

Winston, I am trying to find some time to post about the attributes, but it's hard given my upcomming vacations and the need to finish 2nd edition of FDG.

But quickly, we want to support attributes for the following reasons:

1. We want reusable assemblies with dependencies to be "reflective", i.e. to advertize what dependencies they have and need to be able to run succesfully.

2. We want to support classic application add-in scenarios (possibly in addition to the callsic DI scenarios). In application add-in scenarios the add-ins need to be smart and know how to compose themselves (i.e the app user just drops an assembly to a foolder). In the classic Di scenarios, the developer does the composition. We are currently investigating how to support the classic DI scenarios (were we do understan develoers don't want to apply attributes).

# David Hill's WebLog said on July 20, 2008 6:01 PM:

I have to say that my last year at Microsoft has been a little strange. Since the Acropolis project,

Leave a Comment

(required) 
(optional)
(required) 
Page view tracker