I've been maintaining the MonoDevelop add-in engine for almost two years now. This engine is based on the SharpDevelop add-in engine, which took ideas from Eclipse. At some point I decided that it would be interesting to be able to reuse the engine in other applications, so I decided to take it out of MD, move it to an independent library and make it more generic. That became Mono.Addins.
This is the list of features of Mono.Addins taken from the announcement:
- Supports descriptions of add-ins using custom attributes (for simple and common extensions) or using an xml manifest (for more complex extensibility needs).
- Support for add-in hierarchies, where add-ins may depend on other add-ins.
- Lazy loading of add-ins.
- Provides an API for accessing to add-in descriptions, which will allow building development and documentation tools for handling add-ins.
- Dynamic activation / deactivation of add-ins at run time.
- Allows sharing add-in registries between applications, and defining arbitrary add-in locations.
- Allows implementing extensible libraries.
- In addition to the basic add-in engine, it provides a Setup library to be used by applications which want to offer basic add-in management features to users, such as enabling/disabling add-ins, or installing add-ins from on-line repositories.
However, creating an add-in engine that fits all application needs is not trivial. Different applications will have different extensibility needs. For example, in MonoDevelop some add-ins need to extend other add-ins, so add-in identity and versioning is an issue to take into account. Lazy loading of add-ins is also important, since and IDE may integrate many tools, but not all of them are needed at the same time. MD also needs to provide complex extension points, such as the solution tree pad, build pipelines or hierarchical menus. MD describes those extension points using XML manifests.
Other more simple applications will have more simple needs. For example, an application may just need to load types from some assemblies copied to some directory. Mono.Addins can also be used in this case without adding development complexity. Instead of using XML manifests, extensions can also be declared using custom attributes, and there is no need to assign identifiers or versions to add-ins, since there won't be add-ins extending other add-ins.
What's interesting is that both applications will be using the same add-in model, and it will be possible to use the same API, documentation and development tools for both cases.
I'd like Mono.Addins to set an standard for building extensible applications in Mono. That's why I'd like to get feedback from applications developers about the library and about add-in development in general. I created a mailing list to collect this feedback: http://groups.google.com/group/mono-addins. If you are developing an application which can be extended by add-ins, please take a look at Mono.Addins and say something!
To know more about Mono.Addins you can read the Introduction to Mono.Addins.
A more detailed guide on using the library can be found here.
And the source code is here.
Enjoy!
4 comments:
Hi Lluis,
Why another AddIn framework?
There are some opensource+crossplatform ones out there already (like for example NApf, see www.codeplex.com/NApf )
Regards,
Matthijs ter Woord
matthijsterwoord@gmail.com
Is this eventually going to be the mirror of the CLR AddIns that Microsoft has been working on?
http://blogs.msdn.com/clraddins/default.aspx
I have used their framework a little, and it seems very extensive, and I think with a little work we can get this .NET 3.5 feature knocked off. Since it is officially going to make it in Framework 3.5.
I would love to help you out some, please let me know if you need any help. nberardi [at] zigamorph.com.
I already answered those questions by mail, but I'll post the answers here just for reference.
There are some similarities between Mono.Addins and NApf, although the
focus is different.
Mono.Addins is just an add-in engine. It intends to be as small as
possible, and avoids imposing an architecture on the host application.
All the effort has been focused in building an add-in engine which is
fast, memory efficient and scalable (a host can efficiently handle
thousands of add-ins).
On the other hand NApf is more focused on building an application
framework. It has an add-in engine similar to Mono.Addins (since it is
based on the SharpDevelop engine), although it isn't probably as
optimized as Mono.Adidns (it's just a guess, since I haven't analyzed
the code). In addition to add-in engine it offers other modules for
managing settings, logging, and other high level UI components. That's
not covered in Mono.Addins and never will.
> Is this eventually going to be the mirror of the CLR AddIns that
> Microsoft has been working on?
Nope, Mono.Addins has a different set of features, and it is more
generic. It would be really hard to build for example MonoDevelop on top
of System.AddIn. The problem is that System.AddIn is based on the
concept of dynamically discovering and instantiating types in an
(optionally) isolated execution context. Mono.Addins is based on a more
generic concept of extension, so you can dynamically discover and load
extensions which are not just 'types' but they can be data of any kind
(for example, an extension could be an image).
We could eventually build System.AddIn on top of Mono.Addins, but I'm
not sure would would get any benefit from that.
Hi,
some time ago I wrote an audio app for Linux with Mono and Gtk#, and I used MonoDevelop as example and reference. I like a lot its Service Oriented Architecture.
At that time I didn't implement it's plugin capabilities, but now with your framework and docs could be easier. Maybe I will retake that project...
Thanks LluĂs,
Jorge
Post a Comment