Understanding the front-end framework from a Java perspective, Nodejs,reactjs,angularjs,requirejs,seajs

Source: Internet
Author: User

"The sudden realization"

See Reactjs today, and suddenly found that they have been using the Freemarker macro very similar,

Suddenly understand a lot of front-end hanging fried sky concept, frame, close-up this article, welcome criticism.


"Nodejs"

Official website: https://nodejs.org/

Synopsis: A "frame" that is extremely important to the front end, it can be said that the epoch-

Analogy in Java: JVM

Detailed:

On the front end, Nodejs has epoch-making significance, do not use the front end Nodejs are embarrassed to say that they are the front,

Do not listen to the backend Nodejs, or can not say the pros and cons of Nodejs and Java, is not a qualified back end.


Nodejs is not a JS frame, do not think it is like the framework of jquery,

Nodejs is the JS runtime, the runtime environment, analogy Java in the JVM,

What is the beginning of Java, is undoubtedly the JVM, since the Jvm,java to boast that they are "once written everywhere run",

Regardless of whether you are Windows or Linux, you can run the. class file whenever a corresponding version of the JVM is installed.


The same Nodejs function is the same as the JVM, but also JS operating environment, regardless of what operating system you are,

Just install the corresponding version of the Nodejs, then you can use JS to develop background programs.


This has epoch-making significance, meaning has been only in the browser to play to play the JS, can do back-end development,

From the Nodejs after the emergence of a large number of use JS to do background development front-end personnel, this part of the staff is the front end of the "full stack programmer."


Remember, Nodejs is the same as the JVM of the JS operating environment, open the front-end personnel toward the back end of the road.



"JS MVC framework"

Related framework: Too many frames, see the following two articles

Http://www.csdn.net/article/2014-02-24/2818519-node-js-mvc-frameworks-for-javascript-developers

Http://www.csdn.net/article/2014-03-25/2818964-web-application-frameworks-for-node-js

Analogy in Java: Ssh1 (struts1+spring+hibernate), SSH2 (Struts2+spring+hibernate), SSM (Springmvc+spring+mybatis)

Detailed:

It says that Nodejs opens the front-end developer portal, and Nodejs analogy to the JVM,

So everyone who learns Java knows what to learn after studying the JVM (Basic)?

Yes, frame,

What are the frameworks in Java, as mentioned above, SSH1,SSH2,SSM and so on,

These frameworks are all MVC frameworks.


Now that the Nodej is there, the JVM appears, and then the JS big God begins to encapsulate the MVC framework, just as the great God of Java begins to encapsulate the MVC framework.

Compared to Java popular several frameworks, Nodejs corresponding to the MVC framework is much more,

See the above two articles, enough to let you see the dazzling.


One of the more famous is Expressjs.


Remember, when you see these JS frames, a little smile, the original is to write the MVC framework, based on Nodejs: Sails. Js,total.js,partial.js,koa. js,locomotive. js,express Js,flatiron. js


"JS Modular"

Related concepts: COMMONJS,AMD,CMD,UMD

Related framework: Commonjs,seajs,requirejs,coolie

Analogy in Java: Import, the right is import.

Detailed:

As stated above, when there is a Nodejs (JVM), with Mvcjs (SSH),

Can imagine, each MVCJS will have how many JS file, this time JS Modularization is sent on the use,


When someone and you say JS modularity how how, feel oneself very hanging of time, dump him a sentence, not is Java import?

Yes, although the front-end seems JS modular how cow x, how to hang, but in Java is import.


But JS in the modular, there are many specifications, such as COMMONJS,AMD,CMD,UMD, feel the head of the Big Bar,

In fact, simply put, COMMONJS is running on the Nodejs side, AMD,CMD,UMD is running in the browser,

Its role is to import a variety of JS files, JS Modular management, can be understood as Java package management,

See this article: http://coolie.ydr.me/introduction/commonjs-amd-cmd-umd.html


Similarly, a mvc,js can be made out of the three-way framework, imagined modularity, JS also corresponds to many frameworks,

such as Commonjs,requirejs,seajs and so on.


Remember, COMMONJS,REQUIREJS,SEAJS and other JS modular framework, follow the various specifications (AMD,CMD,UMD,COMMONJS), analogy with import in Java


"Reactjs"

Official website: http://facebook.github.io/react/

Introduction: A framework that was soon before Facebook, the front-end cult.

Analogy with Java: Freemarker macros.

Detailed:

Shortly before Facebook, a JS frame, Reactjs,

For a time, all used Reactjs, or heard Reactjs front-end development on superior,


So, what is this framework for, let's take a look at an example of the official website:

Okay, I don't know, it's okay, I say,

On the left is a piece of code, the right is the effect of this code on the page,

The upper section of the code on the left is defined, and the last word is used,

The left code JSX is the REACTJS format, next to a compiled JS is jsx compiled JS, the native JS.


In other words, you write Jsx file, compiled into a section of JS file, this JS file run is the right effect,

So what's the benefit?

is a package, a large section of the JS definition, and finally only need a sentence output, that is, a line of JS code corresponding to the right of a UI component.

Reactjs's biggest role is to develop UI components, such as this: Http://material-ui.com/#/components/dropdown-menu

Cool effect, material UI style WebUI component, developed based on Reactjs.


Do not know to do Java Freemarker did not, used freemarker do not know to use the macro did not, see paragraph code:

----------------------------------------------

-----------------------------------------------

------------------------------------

------------------------------------

The first picture is a freemarker with a macro that encapsulates the Bootstrap button component,

The second picture is in code with the use of the encapsulated Bsbutton,

The third picture is an effect


have found and Reactjs very similar ah, but Reactjs is in the front-end implementation,

The Freemarker is implemented at the backend, where the common denominator is encapsulation and can be used to pass parameters.


Remember, Facebook's Reactjs is a JS framework for developing UI libraries, characterized by the ability to encapsulate a lot of code.


More

NPM vs Maven

Angularjs vs Freemarker (V)


More Highlights: http://uikoo9.com/


Understanding the front-end framework from a Java perspective, Nodejs,reactjs,angularjs,requirejs,seajs

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.