5

How does MAF compare to OSGi?

MAF is not something that I could find easily, and I am wandering why people don't recommend it as much as, say, MEF? It seems to be similar to OSGi, at least from my first glance.

Andriy Drozdyuk
  • 58,435
  • 50
  • 171
  • 272
  • FYI for any future OSGi visitors, [this](http://www.developerfusion.com/article/9396/creating-extensible-applications-with-maf/) is an excellent overview of how MAF essentially works. One can see that it is not really the same as OSGi, but geared more towards creating Many(addins)-to-one(host). It would still be possible to write "bundles" (in a sense) in MAF, but one would required about **six** classes of boilerplate for each bundle. And each has to be in it's own directory. Read the [article](http://www.developerfusion.com/article/9396/creating-extensible-applications-with-maf/). – Andriy Drozdyuk May 28 '13 at 05:50

2 Answers2

9

Apart from the obvious differences:

MAF

  • driven by Microsoft, therefore proprietary
  • language is C#

OSGi

  • driven by a consortium, open
  • language is Java

There are also a lot of functional differences. For example MAF is more about a host<->plugins architecture, where you have one main host and the plugins provide additions to it; whereas OSGi provides a framework where modules talk not only to one central unit, but also to each other.

Writing plugins for MAF is quite heavy - you have to provide 7 parts - the host, host view, host adapter, contract, add-in adapter, add-in view, add-in - in order to make the whole work. With OSGi you have simply a normal Java JAR file with a manifest file where you declare dependencies, and optionally also provide headers for handling IoC (if you prefer to use the inversion of control pattern).

famousgarkin
  • 13,687
  • 5
  • 58
  • 74
pooh
  • 652
  • 3
  • 2
  • Wow, thanks! It is rare to find a person who knows both Java and .NET tehchnologies. Could you provide some insight into this MEF vs OSGi question - all the answers there are not really comprehensive: http://stackoverflow.com/questions/709532/is-mef-osgi-for-net – Andriy Drozdyuk May 30 '12 at 13:51
1

It is similar to OSGi. There are a few differences, of course, because MAF leverages AppDomains, which AFAIK don't have a Java equivalent (IIRC OSGi uses child JVMs). There are some issues with it- it is not promoted heavily by Microsoft, which probably explains the lack of community interest.

My only real complaint is that it requires you to structure your projects in a fairly rigid way, making both the host and hosted assemblies somewhat "MAF-aware". It definitely works, though I am not sure that there is much there that couldn't be home-grown in relatively short order by a good dev.

Chris Shain
  • 50,833
  • 6
  • 93
  • 125