当前位置:网站首页>Notes - Chang Geng
Notes - Chang Geng
2022-07-16 05:34:00 【qinqinzqq】
part one
There are two other things that really drive computers to form their own engineering systems :
- People's ability hasn't become stronger , At least not stronger at the same level .
- Man will make the best of everything
Because people don't have the ability “ keep pace with ” machine , That's why there are all kinds of models 、 Method 、 Tools and so on to make up for people's shortcomings , To maximize machine performance . It's like a sentence I suddenly thought of when flash memory was boring the other day : Structure is a compromise of objective deficiency , Norm is a compromise of subjective deficiency .
When we need machines to do more , We can't do everything on one chip , That's why there's a von Neumann model 、 Computer architecture , It can't be solved by one machine , That's why we need the Internet 、 Distributed 、 Cloud computing .
Again , With the development of computers , There's so much to do , So there's the concept of software . When “ Development ” Formalization , The software we need becomes : Functional complexity 、 Management unification 、 Multiple entrance .
What really changes is not the objective nature , It is demand. . Like I said here “ Software entrance ” Objectively, we have only one , In principle, there is only one startup program 、 A snippet of startup code . but “ Software entry ”, Has been referred to from Main Function becomes the beginning of reference UI, Users have changed from referring to professionals to referring to general consumers , Software requirements first , The definition of software , And demand is changing .
A software needs several orders of magnitude more code than at that time :
- Objectively, we can't make a display that can show all the codes
- Subjectively, we can't see all the code in super fast scrolling
So we need to add indexes 、 Organize code with multiple files .
The development of machines and the demand expansion and refinement of software , We're starting to have a user interface (User Interface) The most suitable language for interface —— Markup language (Markup Language). Of course ,ML Not for UI Born , It's just perfect UI, That's why UI Fall in love .
Because it's higher UI The needs of , That's why the code is officially divided into descriptions of what to do ( Business logic ) And what (UI) The two part , Because we can't work in two ways of thinking at the same time , The human brain in development is single threaded . What we see is going on at the same time UI And logic development is just that we learned to switch quickly in two modes , Looks like it's going on at the same time , Not really at the same time . The same thing happens in the development of different pieces of code .
part two
When demand becomes huge , The solution is going to be huge ; When the solution becomes large , There will be subdivisions ; When subdivision occurs , There will be questions about how to manage it .
Software has evolved from dealing with one transaction to dealing with many transactions , Among all affairs 、 The order 、 The relationship between primary and secondary , It's getting more and more complicated . Because data and logic are huge , So data and logic are separated , And then the event and the business are separated .
Their relationship has continued to develop before we can make it clear, and it has become more difficult to make it clear , But at one point in time , they UI And the field is roughly divided into these atoms :
- Interface
- data
- event
- Business
If you want to elaborate, there will be more complicated details , But I believe it's less controversial .
When a problem comes up once, it's a problem , When a problem occurs countless times, it becomes history , When a problem will occur many times , It will require a clear definition and solution .
among , The problem of data updating and interface updating has been magnified countless times , Because it's happened countless times .
MVC The general process of :View( Interface ) Triggering event -->Controller( Business ) Handled the business , And then triggered a data update --> I don't know who updated it Model The data of -->Model( With data ) Back to View-->View Update data
Yes MVC The idea of improvement is the same : Severed View and Model The connection of , Give Way View And the only Presenter( primary Controller) Interaction , Reduce the number of objects that need to be maintained during demand changes .
This way suits our expectation , Because we tend to :
- Solve problems at a lower cost
- Solve problems in a more understandable way
Many times it's not a bad model , It's because people can't do it , For example, it's not easy to understand , We will choose an easy to understand way . Computers rely on Moore's law to solve problems with increasing numbers , And people solve problems by changing their ways . Also because of objective reasons, we are not good at maintaining the relationship between multiple objects , So we changed , Or simplified this way .
MVP Defined Presenter and View Interface between , Some can be independently developed according to the existing interface protocol , So as to solve the problem of frequent change of interface requirements . There are interfaces in the above two figures , However, the implementation and use details of the interface are different , But it's the same in mind .
What I want to mention here is , in fact , The most frequent demand change is not necessarily the closest user interface , But it's almost certain , The interface closest to the user is the one that needs to be changed most frequently due to changes in requirements . Of course , If View If it is API instead of UI, Let's say something else .
ViewModel Basically MVP Of Presenter and MVC Of Controller 了 , and View and ViewModel There is no room. MVP Interface of , It's direct interaction , Using data “ binding ” Data update events do not require developers to manually write special use cases , It's automatic two-way synchronization . You can think of data binding as Observer Pattern or Publish/Subscribe Pattern , The principle is to Using a unified and centralized way to realize frequent data updating .
Compared with MVP,MVVM Not only simplifies the dependency between business and interface , It also optimizes the solution of frequent data update , It even provides an effective solution mode .
------ Excerpt from 《 from Script To Code Blocks、Code Behind To MVC、MVP、MVVM》
边栏推荐
- C语言:结构体中链表的添加与删除
- 【黄啊码】PHP配合xlswriter实现无限表头层级Excel导出
- js--笔试题(集)
- [Huang ah code] teacher, I want to choose software development related majors after the college entrance examination. Which direction do you think is good? How to fill in the college entrance examinat
- ES6--string(字符串)
- js作用域与作用域链
- 39.js--作用域
- [Huang ah code] getting started with MySQL - 2. Using data definition language (DDL) to operate the database
- (cvpr-2022) Lagrangian motion analysis and perspective embedding for improved gait recognition
- fastadmin的二次开发教程【简单搭建、多表格问题,API开发】
猜你喜欢

fastadmin的二次开发教程【简单搭建、多表格问题,API开发】

ES6新增的变量修饰符let和const、新增的基本数据类型symbol

keil报错: ERROR 118 (ERRONEOUS REFERENCE TO EXTERNAL VARIABLES) 解决方案及原因
c语言中的输入输出函数之printf函数

初识c语言(一)

37.js--对象的成员操作和原型对象的操作(主要是相关程序举例)
![[Huang ah code] Microsoft Internet Explorer will be retired. Netizens said: what should I do in the future?](/img/38/42fffa40b5db9399ee8c526e0c4439.png)
[Huang ah code] Microsoft Internet Explorer will be retired. Netizens said: what should I do in the future?

window系统盘瘦身(开发)

39.js--作用域

The 13th provincial competition of Bluebridge cup single chip microcomputer
随机推荐
:class修改样式
初识c语言(一)
Understanding service governance in distributed development
window系统盘瘦身(开发)
JS收官笔记
非功能方面测试
Memo, usememo, usecallback summary
Blue Bridge Cup: the second game of the 13th provincial competition of single chip microcomputer group
网络基础知识
Oracle数据库 错误代码解决办法
组件化编程之组件基础
(cvpr-2022) Lagrangian motion analysis and perspective embedding for improved gait recognition
js复制文本到剪切板
2.内存泄漏与内存溢出
ES6新增的class类
淘宝项目练习总结
蓝桥杯单片机第13届省赛题
树结构工具-TreeUtil使用
FTP 上传文件脚本说明
第一次放生,感觉很奇妙