views:

52

answers:

1

Hi

Can you please explain how the following three are different in their intent?

1) Policy Injection Application Block

2) Structure Map IoC

3) Managed Extensibility Framework

In terms of the common tasks they do, which is simpler/aligned with generics and C# 3.0 ?

Thanks

Lijo

+3  A: 

Hi

The three libraries frameworks have different indents, but part of the functionality overlap with each other.

  1. Policy Injection Application Block: This is basically a framework for integrating crosscutting concerns into your application. For example to implement logging of methods without touching to original class. So it provides aspect oriented programming functionality.
  2. Structur Map IoC: Structur Map is a Dependency Incection / Inversion of Control container. The main goal here is to construct and wire objects together in a clean way. This should result in code which is easier to test and understand.
  3. MEF's is a extension-system. It's main goal is to provide a plugin mechanism, where lots of components and plugins can register and discover each other. (like visual-studio addins).

Each library has a different focus. But often parts of these library overlap. For example.

  • Lots of dependency injection framework provide some aspect oriented programming capablities, like the Policy Injection Application Block. But it's not the focus and therefore not as powerful.
  • MEF uses very similar principals to the most IoC-containers (like Structure Map). And in fact it's also a IoC-container. But the focus is on wiring components together.

For example:

  • You want to implement cross cutting concerns, like logging, security etc. Use the Policy Injection Application Block
  • You want to structure your application well, so that it's testable and easier to understand? An IoC-container like StructureMap can help
  • You want to build a plugin-model for your application? Take MEF.

And of course, you can mix those technologies.

Gamlor