护眼

简单了解MVC,MVP和MVVM之间的不同与联系


1 人围观 / 2021-07-17 /

MVC(Model-View-Controller)分别为View(视图,用户界面),Model(模型,数据保存),Controller(控制器,逻辑)

视图层发指令(Dom事件)给控制器,控制器完成逻辑处理,请求模型改变状态,模型将最新的数据发送给视图,得到反馈,各个之间通信是单向的

也可以Controller接受指令,要求模型改变状态,模型将最新的数据发送给视图

MVP(Model-View-Presenter)实质是就是将Controller(控制器,逻辑)改为Presenter(从模型中获取数据,并且提供数据给视图)

各个通信之间是双向的,视图和模型并不联系,通过Presenter进行传递,全部逻辑都在Presenter进行处理

MVVM(Model-View-ViewModel)实质上就是MVC的改进版,和MVP模式基本一致,不过MVVM采用了双向绑定,视图变化,自动反映在ViewModel中

在前端中Model是用json表示,将Model和View关联起来的是ViewModel,Mode数据可以显示到View中,也可以将View修改回Mode

注意:本站未注明转载的文章均为原创,转载请注明来源


上一篇:宝,你今天干嘛了?会不会打扰到你?

下一篇:没有了





评论






首页

Fixie bespoke

Fashion axe 90's pug fap. Blog wayfarers brooklyn dreamcatcher, bicycle rights retro YOLO.Iphone artisan direct trade ethical Austin. Fixie bespoke banh mi ugh, deep v vinyl hashtag. Tumblr gentrify keffiyeh pop-up iphone twee biodiesel. Occupy american apparel freegan cliche. Mustache trust fund 8-bit jean shorts mumblecore thundercats. Pour-over small batch forage cray, banjo post-ironic flannel keffiyeh cred ethnic semiotics next level tousled fashion axe. Sustainable cardigan keytar fap bushwick bespoke.

Fixie bespoke

Fashion axe 90's pug fap. Blog wayfarers brooklyn dreamcatcher, bicycle rights retro YOLO.Iphone artisan direct trade ethical Austin. Fixie bespoke banh mi ugh, deep v vinyl hashtag. Tumblr gentrify keffiyeh pop-up iphone twee biodiesel. Occupy american apparel freegan cliche. Mustache trust fund 8-bit jean shorts mumblecore thundercats. Pour-over small batch forage cray, banjo post-ironic flannel keffiyeh cred ethnic semiotics next level tousled fashion axe. Sustainable cardigan keytar fap bushwick bespoke.

Chillwave mustache

Squid vinyl scenester literally pug, hashtag tofu try-hard typewriter polaroid craft beer mlkshk cardigan photo booth PBR. Chillwave 90's gentrify american apparel carles disrupt. Pinterest semiotics single-origin coffee craft beer thundercats irony, tumblr bushwick intelligentsia pickled. Narwhal mustache godard master cleanse street art, occupy ugh selfies put a bird on it cray salvia four loko gluten-free shoreditch.

Austin hella

Fashion axe 90's pug fap. Blog wayfarers brooklyn dreamcatcher, bicycle rights retro YOLO.Ethical cray wayfarers leggings vice, seitan banksy small batch ethnic master cleanse. Pug chillwave etsy, scenester meh occupy blue bottle tousled blog tonx pinterest selvage mixtape swag cosby sweater. Synth tousled direct trade, hella Austin craft beer ugh chambray.

Austin hella

Fashion axe 90's pug fap. Blog wayfarers brooklyn dreamcatcher, bicycle rights retro YOLO.Ethical cray wayfarers leggings vice, seitan banksy small batch ethnic master cleanse. Pug chillwave etsy, scenester meh occupy blue bottle tousled blog tonx pinterest selvage mixtape swag cosby sweater. Synth tousled direct trade, hella Austin craft beer ugh chambray.

赣ICP备: 19008729-3号赣ICP备19008729-3号

 

Jshb of: TypechoJshb ofTypecho

未知歌曲

00:00
00:00

☺旧时光

关闭