Skip to content
This repository was archived by the owner on Dec 18, 2017. It is now read-only.
This repository was archived by the owner on Dec 18, 2017. It is now read-only.

Bait and switch Plugins? #49

@Cheesebaron

Description

@Cheesebaron

Would love to not have to have Bootstrap files for each plugins, in a similar fashion that Refit, Splat, ModernHttpClient does.

How to do this is described here:
http://log.paulbetts.org/the-bait-and-switch-pcl-trick/

In short it would mean that Assembly Name, Version and Method structure should be the same in the PCL part of the plugin and the platform part.

So as an example if we take the PictureChooser Plugin the structure would be something like:

PictureChooser.nuspec  
    portable-net45+win+wpa81+wp80/
        MvvmCross.PictureChooser.dll     // PCL Version
    net45/
        MvvmCross.PictureChooser.dll     // WPF Bitmap Loader
    Xamarin.iOS10/
        MvvmCross.PictureChooser.dll     // UIKit Bitmap Loader
    MonoAndroid/
        MvvmCross.PictureChooser.dll     // Android Bitmap Loader
    ... more here ...

So the PCL would contain a class like this:

public class Derp
{
    public void Herp(string derrr)
    {
        throw new NotImplementedException();
    }
}

And a Platform specific one:

public class Derp
{
    public void Herp(string derrr)
    {
        Console.WriteLine(derrr); // or maybe something more platform specific
    }
}

So the PCL version is just a stupid Facade for the platform specific one, then on invocation the correct one will be chosen.

Ideas, thoughts, yay or nay?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions