[Mono-list] Does Mono Support the development of plugin based programs?
Josiah
Bennett_J at aol.com
Fri Sep 12 12:10:52 UTC 2014
Thanks for the quick replies guys,
I'm briefly familiar with MEF so that might be one option. I know what to
reference for MEF when developing in Visual Studio 2010 for Windows, But
what would I need to reference so that it works across multiple OS types?
Luke,
I'm interested in how you've setup your plugin system so that Plugins only
need to reference your API Interfaces. It would be nice to setup my program
this way, But what are you going thru to find and load them, Or more
specifically, what would I need to do to implement something like that? I
could dig thru your code files to figure it out, But I really would prefer
not to.
luke wrote
> I would not suggest MEF even if it works with mono because it will force
> your plugin developers to have a hard reference to MEF itself, which might
> not be optimal if you'd like to have the ability to have plugins as PCL's
> (portable class libraries).
>
> Take a look at what we're doing with Media Browser:
>
> https://github.com/MediaBrowser/MediaBrowser
>
> We have a plugins directory where we find and load assemblies. Then we
> have
> a library of interfaces that plugins can implement. For example, here's
> the
> interface for a video channel, called IChannel:
>
> https://github.com/MediaBrowser/MediaBrowser/blob/master/MediaBrowser.Controller/Channels/IChannel.cs
>
> And here is an implementation from the Vimeo plugin, contained in another
> repository:
>
> https://github.com/MediaBrowser/MediaBrowser.Channels/blob/master/MediaBrowser.Plugins.Vimeo/VimeoChannel.cs
>
> The only thing a plugin has to do is implement the interfaces it intends
> to
> support. No manual wireup. No dependencies on MEF or any other similar
> third party library. No custom attributes required. Then once we have the
> assemblies loaded into memory, we use SimpleInjector to find and
> instantiate the instances:
>
> https://github.com/MediaBrowser/MediaBrowser/blob/master/MediaBrowser.ServerApplication/ApplicationHost.cs#L737
>
> This also gives us dependency injection via constructor parameters. For
> example, our core library has an ILogger interface which the Vimeo channel
> can utilize just by adding it to it's constructor. The core interfaces are
> then distributed via nuget packages that contain only the interfaces and
> don't expose implementations or core dependencies.
>
> I'm pretty happy with what we've done but if anyone would like to comment
> with possible improvements I'd love to hear them.
>
>
> On Fri, Sep 12, 2014 at 1:46 AM, Wayne Douglas <
> wayne@
> > wrote:
>
>> Does MEF run on mono?
>> —
>> Sent from Mailbox <https://www.dropbox.com/mailbox>
>>
>>
>> On Fri, Sep 12, 2014 at 6:15 AM, Miljenko Cvjetko <
>>
> mcvjetko@
>> wrote:
>>
>>> Hi
>>>
>>> On 20140912 05:25 , Josiah wrote:
>>>
>>> Hi all,
>>>
>>> I'm looking at options for cross-platform development and I was
>>> wondering if
>>> Mono supports the ability to create a program that can load plugins.
>>>
>>> Mono supports MEF since version 2.8, besides it has Mono.Addin
>>> implemetation equivalent to MAF.
>>> For MEF I think you need to apply a few patches in order to get it to
>>> work on case sensitive filesystems, but it works.
>>>
>>>
>>> http://stackoverflow.com/questions/3909383/mono-and-mef-are-they-compatible
>>>
>>>
>>> http://stackoverflow.com/questions/3685659/programming-with-maf-and-mef-on-mono
>>>
>>> http://stackoverflow.com/questions/1592779/mef-vs-mono-addin
>>>
>>> http://tirania.org/blog/archive/2008/Sep-07.html
>>>
>>> HTH
>>>
>>> mel
>>>
>>>
>>> Any help would be appreciated.
>>>
>>>
>>>
>>> --
>>> View this message in context:
>>> http://mono.1490590.n4.nabble.com/Does-Mono-Support-the-development-of-plugin-based-programs-tp4663822.html
>>> Sent from the Mono - General mailing list archive at Nabble.com.
>>> _______________________________________________
>>> Mono-list maillist -
> Mono-list at .ximian
> ://lists.ximian.com/mailman/listinfo/mono-list
>>>
>>>
>>>
>>
>> _______________________________________________
>> Mono-list maillist -
> Mono-list at .ximian
>> http://lists.ximian.com/mailman/listinfo/mono-list
>>
>>
>
>
> --
> Luke Pulverenti
>
> _______________________________________________
> Mono-list maillist -
> Mono-list at .ximian
> http://lists.ximian.com/mailman/listinfo/mono-list
--
View this message in context: http://mono.1490590.n4.nabble.com/Does-Mono-Support-the-development-of-plugin-based-programs-tp4663822p4663835.html
Sent from the Mono - General mailing list archive at Nabble.com.
More information about the Mono-list
mailing list