当前位置:网站首页>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 )
边栏推荐
- Latex formula code
- LM08丨网格系列之网格反转(精)
- On June 30, 2022, the record of provincial competition + national competition of Bluebridge
- Basic number theory -- combinatorial number
- [getting started] intercepting strings
- Gdip - hatchbrush pattern table
- getInputStream() has already been called for this request
- [staff] key number (key number identification position | key number marking list | a major key identification principle | F, C, G position marking ascending | F major key identification principle | B
- 【无标题】
- Anddroid 文本合成语音TTS实现
猜你喜欢
![[untitled]](/img/b9/6922875009c2d29224a26ed2a22b01.jpg)
[untitled]

How outlook puts together messages with the same discussion

She is the "HR of others" | ones character

window c盘满了

How to use layui to display the data in the database in the form of tables

SharePoint - how to quickly check whether SharePoint is standard or enterprise edition?

Gdip - hatchBrush图案表

【无标题】

Caesar
![[batch DOS CMD summary] extension variables - delay variables CMD /v:on, CMD /v:off, SETLOCAL enabledelayedexpansion, disabledelayedexpansion](/img/ce/6c9e4f2c54710610e8b1f68d6d8088.png)
[batch DOS CMD summary] extension variables - delay variables CMD /v:on, CMD /v:off, SETLOCAL enabledelayedexpansion, disabledelayedexpansion
随机推荐
Array: question brushing record
Li Kou daily question - day 31 -202 Happy number
Find the nearest n-th power of 2
一套十万级TPS的IM综合消息系统的架构实践与思考
Rk3399 platform development series explanation (network debugging) 7.30. What will affect the sending process of TCP packets?
Airsim雷达相机融合生成彩色点云
Cyclic neural network
[batch dos-cmd command - summary and summary] - Common operators in the CMD window (<, < <, & <,>, > >, & >, & >, & &, ||, (),;, @)
IMDB practice of emotion classification (simplernn, LSTM, Gru)
Wang Yingqi, founder of ones, talks to fortune (Chinese version): is there any excellent software in China?
Latex table
How to troubleshoot SharePoint online map network drive failure?
How to check ad user information?
Principle and process of embossing
[getting started] enter the integer array and sorting ID, and sort its elements in ascending or descending order
PostgreSQL source code learning (26) -- windows vscode remote debugging PostgreSQL on Linux
SharePoint - modify web application authentication using PowerShell
【入门】截取字符串
LM08丨网格系列之网格反转(精)
Teach you how to apply for domestic trademark online step by step