当前位置:网站首页>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
边栏推荐
- this. getOptions is not a function
- Using queue to realize stack
- iTOP4412 HDMI显示(4.0.3_r1)
- launcher隐藏不需要显示的app icon
- MySQL笔记2_数据表
- Handler进阶之sendMessage原理探索
- 项目,怎么打包
- Bottomsheetdialogfragment conflicts with listview recyclerview Scrollview sliding
- Explore how @ modelandview can forward data and pages through the source code
- MySQL notes 1_ database
猜你喜欢
随机推荐
DCMTK(DCM4CHE)与DICOOGLE协同工作
从0开始封装一套项目的网络请求框架
Dolphinscheduler集成Flink任务踩坑记录
[多屏互动] 实现双多屏异显二:startActivity方式
Abnormal record-19
MarkDown基础语法笔记
组件化学习(1)思想及实现方式
[exynos4412] [itop4412] [android-k] add product options
Android面试计网面经大全【持续更新中。。。】
Recyclerview 批量更新View:notifyItemRangeInserted、notifyItemRangeRemoved、notifyItemRangeChanged
oracle存储过程中is和as区别
Viewpager2 realizes Gallery effect. After notifydatasetchanged, pagetransformer displays abnormal interface deformation
[sm8150] [pixel4] LCD driver
mysql和pgsql时间相关操作
双指针仪表盘读数(一)
谷歌AdMob广告学习
BottomSheetDialogFragment 与 ListView RecyclerView ScrollView 滑动冲突问题
Component learning
org. xml. sax. SAXParseException; lineNumber: 141; columnNumber: 252; cvc-complex-type. 2.4. a: Found element 'B
iTOP4412 FramebufferNativeWindow(4.0.3_r1)









