No. 2019.1.7 interview preparation

1.mvc and mvp and mvvm mode

MVC

MVC is the framework react with unidirectional data stream is

Advantages: All data changes traceable disadvantages: large amount of code. Long data transfer process

  • transmitting instructions to view the controller layer layer
  • complete the business logic controller, Model required to change state
  • Model data will be sent to the new View layer, user feedback

All communication is one-way

MVP

We write the code is common mode mvp

Features: Operation DOM node

view receive a response back to the p-layer

Take the p-layer data to the m-th layer

m layer of p-layer p-layer returned to back to a logical computing v layer

mv layers do not communicate to the rest of the communication is bidirectional

MVVM

vue mvvm mode is used

Features: not pretentious Dom node, a small amount of code. Cons: Data without trace, especially large projects, a number of changes to data headaches

Mvp is the difference between p layer becomes a layer vm

V layer fluctuation data, automatically vm reaction layer to cause changes in the data layer or vice versa m

vm vue implemented mainly by the layer multiplexing and es5 dom one api object.defindproper ()

 2. The difference between single-page application and multi-page applications

Multi-page application:

Advantages: more friendly to search engines SEO, fast-fold request

Cons: Slow to switch page (http request to switch pages each server)

Single Page Application:

Cons: unfriendly SEO. Home Request slow

Pros: fast page switching // server side rendering solution ssr

Guess you like

Origin www.cnblogs.com/-constructor/p/12159281.html