通过不通过API的应用程序共享模型 [英] Share a model through apps without API

查看:131
本文介绍了通过不通过API的应用程序共享模型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以通过其他应用程序共享模型?如果可能的话,如何做到这一点。



是的,也许我们可以为这些应用程序实现API,但是如果应用程序可以在没有任何外部库的情况下为彼此共享模型,那将很酷: - )版本的 相同的应用程序(这些版本实际上是您的其他应用程序)。如果是这样,那么可以通过将每个其他应用程序部署为同一应用程序的不同版本来实现。这样他们应该能够共享相同的数据存储。我还没有尝试过这个,但是从我读到的这个应该是可能的。可能会得到更多的信息,如果有人发布,或者如果我最终自己尝试这个,我会让你知道。



更新:我尝试了这一点,它但只有一个小问题和一个可能很重要的问题。小问题是你必须找出一种方法在你的两个应用程序中复制相同的数据模型(或者至少是你需要的)。更大的问题是,在一个应用程序中进行的数据存储区提交可能在一段时间内对其他应用程序不可见,并且时间长短取决于您部署的位置/方式。


Is it possible to share a model through other apps? if possible, how to do this.

Yeah, maybe we can implement API for those apps, But if apps can share their models for each other without any external libs, it would be cool :-)

解决方案

You could possibly broaden your definition of "other applications" in the original question to include other versions of the same application (where these versions are really your "other applications"). If so, then this could be possible by deploying each of your "other applications" as a different version of the same application. That way they should be able to share the same data store. I've not yet attempted this myself but from what I read this should be possible. Might get some more info if anyone posts here, or if I end up trying this myself I'll let you know.

Update: I tried this out and it works but with one minor and one possibly significant issue. The minor issue is that you have to work out a way to duplicate the same data model across your two apps (or at least as much as you need). The bigger issue is that datastore commits made in one application may not be visible to the other application for quite some time, and that amount of time varies depending on where/how you're deploying.

这篇关于通过不通过API的应用程序共享模型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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