MCPcopy Index your code
hub / github.com/KunMinX/MVI-Dispatcher

github.com/KunMinX/MVI-Dispatcher @7.6.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release 7.6.0 ↗ · + Follow
377 symbols 792 edges 55 files 89 documented · 24% updated 2y ago7.6.0 · 2023-09-14★ 3271 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Development story:

《Android: Solving the Pain Points of MVI Architecture in Practice》

 

Reactive programming is conducive to unit testing, but it has its own flaws. MVI is designed to eliminate these flaws.

MVI has a certain threshold and is more cumbersome to implement. It also has performance issues, which may cause some colleagues to give up and return to traditional methods.

Overall, MVI is suitable for implementing a "modern development model" in combination with Jetpack Compose.

On the other hand, if you are pursuing "low cost, reusability, and stability", the problem can be solved from the source by following the "single responsibility principle".

In response to this, MVI-Dispatcher was born.

 

Collect or topped Smooth transition Delete notes

 

Project Description

The author has long focused on the "business architecture" pattern and is committed to eliminating unexpected issues in the agile development process.

In this case, I will show you how MVI-Dispatcher can easily accomplish the previously complicated and error-prone message distribution process with just a few lines of code.

implementation 'com.kunminx.arch:mvi-dispatch:7.6.0'

 

A complete "domain layer" message distribution component should at least meet the following requirements:

  1. It contains a message queue that can store messages that have been sent but not consumed.
  2. When the page is not visible, any messages sent during the queue storage period will be automatically consumed when the page becomes visible again.

MVI-Dispatcher was born to meet these needs.

 

Furthermore, the improvements and optimizations of MVI-Dispatcher include:

  1. It can completely eliminate mutable boilerplate code, without writing a single line.
  2. It can prevent new team members from misusing mutable.setValue() in Activity/Fragment.
  3. Developers only need to focus on input and output. They inject events through the unique input entry point and observe them through the unique output exit point.
  4. New team members can automatically implement "reactive" development based on the concise and easy-to-understand input-output design of MVI-Dispatcher without being familiar with LiveData, UnPeekLiveData, SharedFlow, mutable, or MVI.
  5. It can be seamlessly integrated into Jetpack MVVM and other pattern projects.

 

 

MVI-Dispatcher provide the minimum necessary source code implementation to complete a notepad software.

Therefore, through this example, you can also obtain content including:

1.Clean code style & standard naming conventions

2.In-depth understanding of “Reactive programming” knowledge points & correct use

3.Full use of AndroidX and Material Design

4.ConstraintLayout Constraint Layout Best Practices

5.Best Practices for Hex Compound State Management

6.Excellent User Experience & Interaction Design

 

Thanks to

AndroidX

Jetpack

SwipeDelMenuLayout

The icon material in the project comes from iconfinder provided free licensed images.

 

Copyright

The scene cases and MVI dispatcher framework of this project are all my independent original designs, and I have the final right to interpret them.

If you need to quote and use the "background and ideas of the framework design of this project" for writing and publishing, please indicate the source of the link.

 

License

Copyright 2019-present KunMinX

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Extension points exported contracts — how you extend this code

NoteDao (Interface)
Create by KunMinX at 2022/6/14 [1 implementers]
app/src/main/java/com/kunminx/purenote/data/repo/NoteDao.java
Observer (Interface)
(no doc) [1 implementers]
architecture/src/main/java/com/kunminx/architecture/data/response/AsyncTask.java
QueueCallback (Interface)
(no doc)
mvi-dispatch/src/main/java/com/kunminx/architecture/domain/queue/FixedLengthList.java
WeatherService (Interface)
Create by KunMinX at 2022/8/24 [1 implementers]
app/src/main/java/com/kunminx/purenote/data/repo/WeatherService.java
Action (Interface)
(no doc)
architecture/src/main/java/com/kunminx/architecture/data/response/AsyncTask.java
_ComplexIntent (Interface)
TODO:可用于 Java 1.8 的 Sealed Class,使用方式见: https://github.com/KunMinX/SealedClass4Java TODO tip 2:此 Intent 非传统意义上的 MVI int
app/src/main/java/com/kunminx/purenote/domain/intent/_ComplexIntent.java
Result (Interface)
(no doc)
architecture/src/main/java/com/kunminx/architecture/data/response/DataResult.java
_NoteIntent (Interface)
TODO:可用于 Java 1.8 的 Sealed Class,使用方式见: https://github.com/KunMinX/SealedClass4Java TODO tip 2:此 Intent 非传统意义上的 MVI int
app/src/main/java/com/kunminx/purenote/domain/intent/_NoteIntent.java

Core symbols most depended-on inside this repo

get
called by 33
mvi-dispatch/src/main/java/com/kunminx/architecture/domain/result/OneTimeMessage.java
input
called by 19
mvi-dispatch/src/main/java/com/kunminx/architecture/domain/dispatch/MviDispatcher.java
getId
called by 15
app/src/main/java/com/kunminx/purenote/data/bean/Note.java
set
called by 15
mvi-dispatch/src/main/java/com/kunminx/architecture/domain/result/OneTimeMessage.java
sendResult
called by 14
mvi-dispatch/src/main/java/com/kunminx/architecture/domain/dispatch/MviDispatcher.java
equals
called by 12
mvi-dispatch/src/main/java/com/kunminx/architecture/domain/result/SafeIterableMap.java
getApp
called by 8
architecture/src/main/java/com/kunminx/architecture/utils/Utils.java
setOnClickListener
called by 8
architecture/src/main/java/com/kunminx/architecture/ui/bind/ClickProxy.java

Shape

Method 301
Class 62
Interface 13
Enum 1

Languages

Java100%

Modules by API surface

mvi-dispatch/src/main/java/com/kunminx/architecture/domain/result/SafeIterableMap.java45 symbols
architecture/src/main/java/com/kunminx/architecture/ui/view/SwipeMenuLayout.java25 symbols
mvi-dispatch/src/main/java/com/kunminx/architecture/domain/result/OneTimeMessage.java21 symbols
app/src/main/java/com/kunminx/purenote/data/bean/Note.java18 symbols
architecture/src/main/java/com/kunminx/architecture/ui/adapter/BaseBindingAdapter.java17 symbols
keyvalue-dispatch/src/main/java/com/kunminx/architecture/utils/SPUtils.java15 symbols
architecture/src/main/java/com/kunminx/architecture/ui/page/BaseFragment.java15 symbols
architecture/src/main/java/com/kunminx/architecture/data/response/AsyncTask.java10 symbols
app/src/main/java/com/kunminx/purenote/data/bean/Weather.java10 symbols
keyvalue-dispatch/src/main/java/com/kunminx/architecture/domain/dispatch/KeyValueDispatcher.java9 symbols
keyvalue-dispatch/src/main/java/com/kunminx/architecture/domain/dispatch/GlobalConfigs.java9 symbols
architecture/src/main/java/com/kunminx/architecture/ui/page/BaseActivity.java9 symbols

For agents

$ claude mcp add MVI-Dispatcher \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page