Code Monkey home page Code Monkey logo

Comments (4)

shifujun avatar shifujun commented on May 29, 2024

动态化是shadow不可或缺的关键设计。那个none-dynamic的demo更多的作用是保持动态化的代码始终分层实现。就是core层应该能单独运行。

因为业务中是不可能单独用core层的。所以在core层先实现一个PPS就没有那么重要了。尽管确实应该这样写代码才更优雅。

none-dynamic的demo显然就是在没有PPS的情况下接入的loader。如果你把接入代码移到另外的进程不就达到你的目的了吗?插件是宿主代码的一部分,所有你在宿主的单独进程中启动插件,插件就看起来运行在插件进程了。PPS就是宿主代码。没有PPS就还缺少跨进程支持插件service的能力,因为我们需要它跨进程传递插件的binder。

from shadow.

SunShineMy66 avatar SunShineMy66 commented on May 29, 2024

1、清单文件中PluginDefaultProxyActivity配置了android:multiprocess="true"属性,表示Activity跑在调用进程里面。
调用进程是在清单文件中通过配置PluginProcessPPS来区分的,所以得创建5个PPS类并在清单文件中配置5个不同进程,并且需要把none-dynamic 模块的loadPlugin代码放到PPS中,对吗?

2、因为Manager、runtime、loader维护起来真心复杂,和版本还可以存在多对多关系,复杂度再次升级,所以我们考虑使用非动态化来实现插件化,,不知道去掉runtime、loader、manager后,是否会
影响后面插件的升级呢?很担心插件里遇到bug,如果使用非动态化方案不能解决这个bug会出问题?

Shadow研究了2个月,还是有很多不懂的,请大佬帮忙分析下上面2个问题,谢谢。

from shadow.

shifujun avatar shifujun commented on May 29, 2024

我不太能理解你说的。比如android:multiprocess是Android系统的定义,不是shadow定义出来的。你的表述好像它是shadow设计的用来控制什么的。

我也不能理解你说的复杂性,因为在我看来不存在所谓的多对多版本。维护代码和发布也很简单。就是这些动态化的部分在升级时没有太大心智负担。如果你能把这部分动态化去掉,那你是插件也可以不动态化了。它们和插件是个整体。分成多个apk只是因为要加载到不同的classloader里。

通过issue空谈效率是很低的,对其他人也不会有什么帮助。建议你可以参与到开源项目中,通过改进项目的sample、demo甚至注释、文档,来加深对项目的理解。比如你想做none-dynamic的模式,你可以改进shadow的none-dynamic demo。对shadow的代码修改也可以在PR中得到落实。合入也可以保证后续的兼容性。

from shadow.

SunShineMy66 avatar SunShineMy66 commented on May 29, 2024

感谢,我先采用none-dynamic模式接进来。后续有改进的地方我听你的,参与到开源项目中。

from shadow.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.