So what are design patterns? When we play a game, we will pursue how to pass the fastest, to pursue what efficient operation to get the best prize; When we get home from work, we open the mobile app to find the most convenient route to take the bus. When ordering takeout, they also order food from the nearest inexpensive and delicious restaurant.
We’re always looking for the easiest solutions, the best practices.
What are the design patterns? It is the trick inside the secret book of martial arts, it is the best practice summed up by the elder, encounter different scenes have the corresponding trick to display, let the enemy be defeated and flee, let the complex code become easy to understand, use the trick to follow one’s desires.
First, JavaScript is multi-mode hybrid code programming, object-oriented, prototype-based, with dynamic data types, on the one hand, functions are treated as first-class citizens, allowing functions to be programming style, on the other hand, does not exclude the traditional object-oriented way of development.
So learning JavaScript, sometimes there are many ways to achieve the same function, so what are the design patterns for learning JavaScript?
Basic: This, new, bind, call, apply, closures and higher-order functions, ES6 knowledge points that may be encountered, inheritance and prototype chain, design principles.
Creative patterns: Single-column pattern, Factory method, Abstract Factory, Builder pattern.
Structural mode: adapter mode, bridge mode, Decorator mode, Composite mode, Appearance mode, Share mode, proxy mode.
Behavioral patterns: template method pattern, command pattern, iterator pattern, publk-subscribe pattern, mediator pattern, actor pattern, policy pattern, Responsibility chain pattern, Visitor pattern, memo pattern.
Some other patterns: MVC, MVP, MVVM, module pattern, chain pattern, middleware.
Basic, need to learn some basic knowledge of JavaScript, create mode, important to understand, single column mode, factory mode, abstract factory mode, builder mode; Structural mode, for details, proxy mode, share mode, adapter mode, decorator mode, appearance mode, composite mode, bridge mode; Behavioral pattern, publish-subscribe pattern, Policy pattern, state pattern, template method pattern, iterator pattern, command pattern, chain of responsibility pattern, mediator pattern.
MVC, MVP, MVVM used for system layer, reduce the coupling between layers, the module pattern, hide the internal properties and methods, only expose the desired part; Chain mode, through the object method to return the current object, to achieve the same object of multiple methods of the chain call; Middleware, the software that sits between the operating system and the applications that handle the data.
Functional programming is a style of programming in which functions are treated as first citizens, generally speaking, as arguments or function return values. Design mode, front – jiuyang Shengong secret. After learning, learning various frameworks makes rapid progress. Np big stick, it looks like you’ve made it
About the current article content is involved in the front-end, PHP knowledge, if you are interested in you can pay attention to, it is a great honor to be found by you, is really smart eye knowledge English! Thank you for your attention. In the future, I hope you can always support me silently, and I will try my best to write more excellent works. We grew up together, learned programming from zero basis, and presented Web front-end fields, data structures and algorithms, network principles and other easy-to-understand to our friends. Share Web front-end related technical articles, tool resources, selected courses, hot news.
Feedback: if this number of content can not do the place (such as: related to copyright or other issues), please contact us for rectification, will be dealt with in the first time.
Thank you for reading. It is not easy to be original. Please give me a thumbs-up if you like.
Welcome to attentiondadaJane books!
This is a blog with quality and attitude