-
Notifications
You must be signed in to change notification settings - Fork 1
Bait and switch Plugins? #49
Comments
Yes!!! |
Agree! |
Well, we would probably still need Bootstrap files if the Plugins need to be registered in the IoC for DI. But could also just be invoked directly if wanted. |
This would only make sense if the plugin doesn't have any code that belongs inside a PCL. |
Care to elaborate @lothrop? From my understanding any class that is not a facade inside of the PCL should still work just fine as long as there isn't an class and method named exactly the same in the platform specific dll. |
Ah, gotcha, I was thinking the PCL wouldn't be used at all and we'd have to link the common code in using a shared project. |
If bait and switch is used then please try to not update/change assemblies versions for the rest of their lives otherwise it could become tricky to manage with NuGet adding some bindingredirect to the app.config file. |
So this is similar to the https://github.com/jamesmontemagno/Xamarin.Plugins. Does it make sense to maintain two different branches of plugins. Or would it make more sense to combine forces at least for trivial plugins that do not use mvx functionality?! |
We have talked to @jamesmontemagno about this and I think moving forward we would contribute our plugins after they have been converted to match the template he uses. Then in MvvmCross just describe how to use those plugins with our IoC. |
Ye that is exactly what I thought.Good to hear. With my Fingerprint- and our BLE plugin we are going the same way. |
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:
So the PCL would contain a class like this:
And a Platform specific one:
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?
The text was updated successfully, but these errors were encountered: