element ui 框架的优势_【语言】函数式语言UI框架优势

本文探讨了函数式编程语言如何改变UI框架,对比了MVVM和MVU模式的区别,强调MVU的单向数据流简化了信息处理。以Elm和Fabulous(F#的跨平台移动应用框架)为例,阐述了函数式语言在UI开发中的应用,并提供了相关资源链接供深入研究。
摘要由CSDN通过智能技术生成

本文章大部分内容整理自dsyme的youtube视频

Fabulous- F# for cross-platform mobile apps

1)Function programing语言给UI开发框架带来的变化

6840e985a6a211fc72368459bdae47b8.png

上面描述了主流的UI框架框架特点及其新的MVU模式框架:动态UI及其UI语言和宿主语言统一是主要特征

DSL(xaml)缺点:

  • separated DSL:sliced off the code
  • xmal is static:不是一个编程语言
  • 我们需要一个separate language为UI?

2)MVVM和MVU(Model-View-Update)区别和优势

6b378b65def25d4b7acb5deb22871e38.png

MVVM:mutation,术语非常多,信息流动难于理解。

b1b247c0119875862c4faa5add799a8e.png

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

2537ac838f37ef00e556e5b05685fb1a.png

MVU完全可以用函数式语言搞定:

5f067f346b91a6c0ac8b3440a1cd2197.png

参考:

下面的文章还需要细读。

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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值