Xamarin 和托管可扩展性框架 (MEF) [英] Xamarin and Managed Extensibility Framework (MEF)

查看:41
本文介绍了Xamarin 和托管可扩展性框架 (MEF)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在考虑一个新的移动/平板电脑应用.

I'm thinking about a new mobile/tablet application.

我想让用户开发自己的插件.

I want to allow the users to develop their own plugins.

想象一个在 Android 平板电脑上运行的收银台应用程序.当连接到信用卡读卡器(Square总结, ...).

Imagine a cash desk application running on a Android tablet. The user could use many alternative when connecting to the credit card reader (Square, Sum'Up, ...).

如果我的应用程序是旧的 Win32,我只会发布一个 API,让 SquareSum'Up 开发人员创建一个 DLL.然后,这个 DLL 将被放置在计算机上的某个地方.在应用程序启动时,我只需要查找那些 DLL 并动态加载它们.

If my application was an old Win32, I would just publish an API and let Square or Sum'Up developpers create a DLL. This DLL would then be placed somewhere on the computer. At application startup, I just have to look for those DLL and dynamically load them.

事实上,真正的问题是:是否可以创建基于插件的应用程序?我正在考虑托管可扩展性框架.很多问题浮现在脑海中:

In fact, the real question is : Is it possible to create a plugin based application ? I'm thinking about Managed Extensibility Framework here. Many questions come to mind :

  • 如何部署这些插件?
  • 这是否适用于所有平台(iOS、Android、UWP)?
  • ...

我找不到任何关于此的文档.

I was unable to find any documentation on this.

非常感谢您的想法和指示.

Many thanks for your thoughts and indications.

推荐答案

不确定这是否完全回答了您的问题.

Not sure if this answers your question fully.

但是,如果您将 DLL 放在可公开发现的地方,例如/storage/emulated/0,则类似 MEF 的架构可能会在 Android 上运行.或者,此类插件可以作为单独的应用程序分发,提供可从其他应用程序使用的服务、内容提供程序和活动.

However, a MEF like architecture could probably work on Android if you put the DLL's somewhere publicly discoverable, such as in /storage/emulated/0. Alternatively, such plugins could be distributed as separate Apps, providing Services, Content Providers and Activities consumable from other Apps.

但是,在 iOS 上,您将无法在 App Store 中发布这样的应用程序,因为 Apple 不允许您在那里使用动态链接库.您可以也许为不在 App Store 上的应用(例如企业发行版)执行此操作.

However, on iOS you would not be able to publish such an App in the App Store though, as Apple does not allow you to use dynamically linked libraries there. You could maybe do it for Apps that don't go on the App Store, such as for Enterprise distribution.

虽然它可能不是最好的解决方案.您将始终能够通过 URL 在 iOS 上的应用程序之间导航.然而,这并不是最好的体验,因为这意味着您每次想要进入插件"时都会离开您的应用程序.应用来做某事.

While it might not be the greatest solution. You would always be able to navigate between Apps on iOS through URLs. However, that is not the greatest experience, since this would mean you would be leaving your App every time you wanted to get into a "plugin" App to do something.

这篇关于Xamarin 和托管可扩展性框架 (MEF)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆