当前位置:网站首页>How can beginners correctly understand Google's official suggested architectural principles (questions?)
How can beginners correctly understand Google's official suggested architectural principles (questions?)
2022-07-01 08:09:00 【Lighthouse @kuaidao】
Preface
Recently, I took the time to read google Of Jetpack Architecture components ,kotlin coroutines 、flow. And then google Official recommended application architecture guidelines ,compose etc. . These are The current mainstream application development technology stack . Our project has been set up , But my understanding is very shallow , The architecture recommended on the official website is not used in writing MVP Write straight . But these are the technology stacks that should be mastered in the future , Record the doubts .
1. Standard data-driven code styles , And the responsibilities of all levels , How the layers are related .
UI layer
Activity、Fragment Whether only ui Related codes : ui Related codes refer to those codes ?
Whether the element is displayed or hidden , Add and remove . Font color value , The picture style , font size , Are you refreshing these only with View Elements that are related to their own attributes .
viewModel What code to put ? What's the effect .
For example , In the login interface [ Conditional check logic ],EditerText Of textChange Logic , Check whether the password conforms to such judgment logic, and put it in ?viewModel You need to expose methods to the interface , Whether these methods need suspend modification .
Domain layer (xxxUserCase)
What type of code is put into the domain layer , If you need suspend modification . What style code is exposed . The domain layer can create object class Singleton class
xxxxResp The repository
Repository split , How to understand repository splitting , How to split is correct or relatively correct .
xxDataSource data source
Data sources in applications only , file , database , Memory , The Internet . If you define these earlier , That is, four data sources . Whether it should be defined in this way
NetDataSource ,DbDataSource ,FileDataSource DataStoreDataSource , So a large project only defines these four data elements , It must not be enough , How to subdivide
In general .
Tool library ,widget Custom layout , Elements , General network request logic , Remove it there ?
There is also the use of synergy , It's also a little knowledge . Nested usage of coroutines , How to control the timing between the network request initiated by the cooperation process and the ordinary network request , Then execute first and then execute another . Parallel execution , Nesting
Write the nested code of the cooperation process according to the gourd drawing , It's hard to write by yourself , The more I write, the less I know . Mainly, the nesting of network request code does not look elegant or beautiful .
How to understand business logic
Functional logic : Explain the logic of this function in detail .
Interactive logic : Explain the mutual jump between pages .
Visual Logic : Right color , Requirements for icons .
Business logic : Talk about the business corresponding to this function .
The business logic is split into functions that implement specific functions , Different functions deal with different problems ( Input data format verification , Format checking )
边栏推荐
- [redis] it takes you through redis installation and connection at one go
- 【入门】截取字符串
- Thesis learning -- Analysis and Research on similarity query of hydrological time series
- How to prevent the other party from saying that he has no money after winning the lawsuit?
- 【刷题】字符统计【0】
- Missing API interface actual development series (14): ID card real name authentication verification
- Php laraver Wechat payment
- LSTM of RNN
- [question brushing] character statistics [0]
- Scala language learning-07-constructor
猜你喜欢
![[getting started] extract non repeating integers](/img/88/3e96df88e980bd98ac112b18a8678c.png)
[getting started] extract non repeating integers
![[untitled]](/img/c2/63286ba00321c9cdef43ff40635a67.png)
[untitled]

Vhost kick & call principle

【批处理DOS-CMD命令-汇总和小结】-Cmd窗口中常用操作符(<、<<、&<、>、>>、&>、&、&&、||、|、()、;、@)

base64

The Windows C disk is full
![[dynamic planning] p1020 missile interception (variant of the longest increasing subsequence)](/img/3e/75a1152f9cdf63c6779fdadec702a0.jpg)
[dynamic planning] p1020 missile interception (variant of the longest increasing subsequence)
![[getting started] intercepting strings](/img/16/363baa4982408f55493057200bcba5.png)
[getting started] intercepting strings

Wang Yingqi, founder of ones, talks to fortune (Chinese version): is there any excellent software in China?

Learn the knowledge you need to know about the communication protocol I2C bus
随机推荐
[MySQL learning notes 25] SQL statement optimization
The difference between interceptors and filters
The Windows C disk is full
Contenttype comparison of all types
P4 安装bmv2 详细教程
Latex formula code
【无标题】
[dynamic planning] p1020 missile interception (variant of the longest increasing subsequence)
Office365 - how to use stream app to watch offline files at any time
【入门】取近似值
AArdio - 【问题】bass库回调时内存增长的问题
Transaction method call @transactional
OJ input and output exercise
事务方法调用@Transactional
How to check ad user information?
力扣每日一题-第32天-1822.数组元素积的符号
Why some people earn nearly 10billion a year, while others earn 3000 a month: the details you ignore actually make the most money
STM32 uses esp01s to go to the cloud, mqtt FX debugging
Two expressions of string
Basic number theory -- combinatorial number