Microsoft Add-in Framework vs OSGi?

5.9k Views Asked by At

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.

2

There are 2 best solutions below

1
On

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.

1
On

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).