- Web Development with MongoDB and Node(Third Edition)
- Bruno Joseph D'mello Mithun Satheesh Jason Krol
- 248字
- 2021-07-08 10:32:36
Sharing and reusing JavaScript
While you develop web applications, you will always end up doing the validations for your UI, both at the client and server sides, as the client-side validations are required for better UI experience and server-side validations are needed for better security of the app. Think about two different languages in action: you will have the same logic implemented in both the server and client sides. With Node.js, you can think of sharing the common function between server and client, reducing the code duplication to a large extent.
Ever worked on optimizing the load time for client-side components of your Single-Page Application (SPA) loaded from template engines such as Underscore? You would end up thinking about a way we could share the rendering of templates in both server and client at the same time; some call it hybrid templating.
Node.js resolves the context of duplication of client templates better than any other server-side technologies, just because we can use the same JS templating framework and the templates both at server and client.
If you are taking this point lightly, the problem it resolves is not just the issue of reusing validations or templates on the server and client. Think about an SPA being built; you will need to implement the subsets of server-side models in the client-side MV* framework also. Now, think about the templates, models, and controller subsets being shared on both client and server. We are solving a higher scenario of code redundancy.
- Learning C# by Developing Games with Unity 2020
- Visual FoxPro程序設計教程(第3版)
- Android Development with Kotlin
- Visual Basic程序設計(第3版):學習指導與練習
- Java程序員面試算法寶典
- Instant QlikView 11 Application Development
- Android 應用案例開發大全(第3版)
- 自制編程語言
- 微服務從小白到專家:Spring Cloud和Kubernetes實戰
- Greenplum構建實時數據倉庫實踐
- Three.js權威指南:在網頁上創建3D圖形和動畫的方法與實踐(原書第4版)
- Learning Cocos2d-JS Game Development
- Spring Boot從入門到實戰
- C語言程序設計教程
- SCRATCH編程課:我的游戲我做主