本文章大部分内容整理自dsyme的youtube视频
Fabulous- F# for cross-platform mobile apps
1)Function programing语言给UI开发框架带来的变化
上面描述了主流的UI框架框架特点及其新的MVU模式框架:动态UI及其UI语言和宿主语言统一是主要特征
DSL(xaml)缺点:
- separated DSL:sliced off the code
- xmal is static:不是一个编程语言
- 我们需要一个separate language为UI?
2)MVVM和MVU(Model-View-Update)区别和优势
MVVM:mutation,术语非常多,信息流动难于理解。
MVU(Model-View-Update):MVU是信息是单向流动,非常简单。View is a function from the model to the view the messages are just functional programming data discriminated unions. 并且Flutter的MVU模式中给出的原因:
The easiest and simplest way I have found to develop an app involves:
- All context for a method is given at the point of calling the method
- Using the simplest path forward because in a rush the developers usually do the simplest thing possible.
3, Elm和Fabulous
https://github.com/fsprojects/Fabulous
MVU完全可以用函数式语言搞定:
参考:
下面的文章还需要细读。
Curry-On 2019 Fabulous- Functional programming for cross-platform mobile apps
https://buildflutter.com/functional-model-view-update-architecture-for-flutter/
https://elmprogramming.com/model-view-update-part-1.html
https://youtu.be/ZCRYBivH9BM