当前位置:网站首页>Component based learning (1) idea and Implementation
Component based learning (1) idea and Implementation
2022-04-23 07:12:00 【Drink dichlorvos alone】
1. Introduction to componentization
I think componentization , The whole project consists of app Shell , Several business components , And common basic components . As shown in the figure

I think the most obvious feature of componentization is : There is no direct horizontal dependency between business modules .
significance : Don't depend on each other , But they can interact with each other ; Highly decoupled ; Free disassembly
2. Componentized deployment
About how to componentize the project , There are a lot of learning resources on the Internet , I recommend an article , It's super detailed : This is the article
3. Communication between components :
Of course, the most commonly used is Alibaba open source ARouter. I won't introduce more about this , But in addition to this way , There are several other more primitive ways
① Use EventBus
shortcoming :EventBus Maintenance costs are high , Poor management
② Use radio
shortcoming : Broadcasting is not easy to manage , Once the message is not handled , The unification was sent out
③ Use implicit intent
shortcoming : stay AndroidManifest.xml It's configured inside xml That's too much
④ Use class loading
shortcoming : It is easy to write wrong package name and class name
principle : become involved apk When the package , It opens at dex file , Find that the modules are together , Pictured 
So this is the inspiration of this kind of loading method
⑤ Use global Map( Low profile version ARouter)
shortcoming : To register a lot of objects .
every last Activity At the time of creation , To the overall situation Map Register inside . When you need to jump , From this overall situation Map Internal basis key Go and get the corresponding Activity object , This completes the communication
版权声明
本文为[Drink dichlorvos alone]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230606380329.html
边栏推荐
- 去掉状态栏
- iTOP4412 SurfaceFlinger(4.4.4_r1)
- 通过rownum来进行区间查询
- 从0开始封装一套项目的网络请求框架
- 解决::Argument ‘radius‘ is required to be an integer
- 【2021年新书推荐】Professional Azure SQL Managed Database Administration
- oracle用delete删除数据所需时间测试
- BottomSheetDialogFragment 与 ListView RecyclerView ScrollView 滑动冲突问题
- 【2021年新书推荐】Enterprise Application Development with C# 9 and .NET 5
- oracle存储过程中is和as区别
猜你喜欢

Personal blog website construction

C connection of new world Internet of things cloud platform (simple understanding version)

mysql和pgsql时间相关操作

【2021年新书推荐】Red Hat RHCSA 8 Cert Guide: EX200

组件化学习(3)ARouter中的Path和Group注解

this. getOptions is not a function

Bottom navigation bar based on bottomnavigationview

iTOP4412 HDMI显示(4.0.3_r1)

开篇:双指针仪表盘的识别

【2021年新书推荐】Effortless App Development with Oracle Visual Builder
随机推荐
js时间获取本周一、周日,判断时间是今天,今天前、后
oracle中生成32位uuid
AVD Pixel_ 2_ API_ 24 is already running. If that is not the case, delete the files at C:\Users\admi
iTOP4412 FramebufferNativeWindow(4.0.3_r1)
oracle杀死正在执行的sql
实习做了啥
【2021年新书推荐】Red Hat RHCSA 8 Cert Guide: EX200
Exception record-14
B站用户视频观看记录的存储方案
C connection of new world Internet of things cloud platform (simple understanding version)
oracle表空间表分区详解及oracle表分区查询使用方法
HandlerThread原理和实际应用
Dolphinscheduler源码包src.tar.gz解压问题
Encapsulate a set of project network request framework from 0
第三篇:docker安装mysql容器(自定义端口)
解决::Argument ‘radius‘ is required to be an integer
利用栈实现队列的出队入队
[Exynos4412][iTOP4412][Android-K]添加产品选项
iTOP4412 FramebufferNativeWindow(4.0.3_r1)
【2021年新书推荐】Enterprise Application Development with C# 9 and .NET 5