Modular Programming with JavaScript

Modularize your JavaScript code for better readability, greater maintainability, and enhanced testability
Preview in Mapt

Modular Programming with JavaScript

Sasan Seydnejad

1 customer reviews
Modularize your JavaScript code for better readability, greater maintainability, and enhanced testability
Mapt Subscription
FREE
$29.99/m after trial
eBook
$25.20
RRP $35.99
Save 29%
Print + eBook
$44.99
RRP $44.99
What do I get with a Mapt Pro subscription?
  • Unlimited access to all Packt’s 5,000+ eBooks and Videos
  • Early Access content, Progress Tracking, and Assessments
  • 1 Free eBook or Video to download and keep every month after trial
What do I get with an eBook?
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with Print & eBook?
  • Get a paperback copy of the book delivered to you
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with a Video?
  • Download this Video course in MP4 format
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
$0.00
$25.20
$44.99
$29.99p/m after trial
RRP $35.99
RRP $44.99
Subscription
eBook
Print + eBook
Start 30 Day Trial

Frequently bought together


Modular Programming with JavaScript Book Cover
Modular Programming with JavaScript
$ 35.99
$ 25.20
Internet of Things Programming with JavaScript Book Cover
Internet of Things Programming with JavaScript
$ 31.99
$ 22.40
Buy 2 for $35.00
Save $32.98
Add to Cart
Subscribe and access every Packt eBook & Video.
 
  • 5,000+ eBooks & Videos
  • 50+ New titles a month
  • 1 Free eBook/Video to keep every month
Start Free Trial
 

Book Details

ISBN 139781785880650
Paperback274 pages

Book Description

Programming in the modular manner is always encouraged for bigger systems—it is easier to achieve scalability with modular programming. Even JavaScript developers are now interested in building programs in a modular pattern. Modules help people who aren’t yet familiar with code to find what they are looking for and also makes it easier for programmers to keep things that are related close together.

Designing and implementing applications in a modular manner is highly encouraged and desirable in both simple and enterprise level applications.

This book covers some real-life examples of modules and how we can translate that into our world of programming and application design. After getting an overview of JavaScript object-oriented programming (OOP) concepts and their practical usage, you should be able to write your own object definitions using the module pattern. You will then learn to design and augment modules and will explore the concepts of cloning, inheritance, sub-modules, and code extensibility. You will also learn about SandBoxing, application design, and architecture based on modular design concepts. Become familiar with AMD and CommonJS utilities.

By the end of the book, you will be able to build spectacular modular applications in JavaScript.

Table of Contents

Chapter 1: What Are Modules and Their Advantages?
Prelude to modular programming
The simple rule for creating modules
A real-life example of modules
A look at a non-modular example
Re-factoring to a more modularized approach
Designing in a modular way
Summary
Chapter 2: Review of Important JavaScript OOP Concepts
JavaScript objects
Summary
Chapter 3: Module Design Pattern
Module pattern
Creating loose coupling among modules
Summary
Chapter 4: Designing Simple Modules
The big picture
Designing our SPA main pieces
Summary
Chapter 5: Module Augmentation
Principles of module augmentation
Implementing module augmentation
Simple augmentation of ImagesInc_GlobalData
The order of things in module augmentation
Loose augmentation of modules
Tight augmentation of modules
Generating our application's content area
Summary
Chapter 6: Cloning, Inheritance, and Submodules
Cloning modules
Creating ImagesInc_Utilites module
Inheritance in modules
Submodules
Summary
Chapter 7: Base, Sandbox, and Core Modules
Application architecture overview
Base module
Sandbox module
Core module
Components
Application architectural considerations
Summary
Chapter 8: Application Implementation – Putting It All Together
The user's view of our application
Application functionality
Application implementation
Application components
GlobalData module
Summary
Chapter 9: Modular Application Design and Testing
Advantages of writing automated tests
Different types of automated tests
A simple start to writing our unit tests
Summary
Chapter 10: Enterprise Grade Modular Design, AMD, CommonJS, and ES6 Modules
Revisiting index.html file
Introducing Asynchronous Module Definition
CommonJS
ECMAScript 6 modules
Summary

What You Will Learn

  • Understand the important concepts of OOP in JavaScript, such as scope, objects, inheritance, event delegation, and more
  • Find out how the module design pattern is used in OOP in JavaScript
  • Design and augment modules using both tight augmentation and loose augmentation
  • Extend the capabilities of modules by creating sub-modules using techniques such as cloning and inheritance
  • Move from isolated module pieces to a cohesive, well integrated application modules that can interact and work together without being tightly coupled
  • See how SandBoxing is used to create a medium for all the modules to talk to each other as well as to the core
  • Use the concepts of modular application design to handle dependencies and load modules asynchronously
  • Become familiar with AMD and CommonJS utilities and discover what the future of JavaScript holds for modular programming and architecture

Authors

Table of Contents

Chapter 1: What Are Modules and Their Advantages?
Prelude to modular programming
The simple rule for creating modules
A real-life example of modules
A look at a non-modular example
Re-factoring to a more modularized approach
Designing in a modular way
Summary
Chapter 2: Review of Important JavaScript OOP Concepts
JavaScript objects
Summary
Chapter 3: Module Design Pattern
Module pattern
Creating loose coupling among modules
Summary
Chapter 4: Designing Simple Modules
The big picture
Designing our SPA main pieces
Summary
Chapter 5: Module Augmentation
Principles of module augmentation
Implementing module augmentation
Simple augmentation of ImagesInc_GlobalData
The order of things in module augmentation
Loose augmentation of modules
Tight augmentation of modules
Generating our application's content area
Summary
Chapter 6: Cloning, Inheritance, and Submodules
Cloning modules
Creating ImagesInc_Utilites module
Inheritance in modules
Submodules
Summary
Chapter 7: Base, Sandbox, and Core Modules
Application architecture overview
Base module
Sandbox module
Core module
Components
Application architectural considerations
Summary
Chapter 8: Application Implementation – Putting It All Together
The user's view of our application
Application functionality
Application implementation
Application components
GlobalData module
Summary
Chapter 9: Modular Application Design and Testing
Advantages of writing automated tests
Different types of automated tests
A simple start to writing our unit tests
Summary
Chapter 10: Enterprise Grade Modular Design, AMD, CommonJS, and ES6 Modules
Revisiting index.html file
Introducing Asynchronous Module Definition
CommonJS
ECMAScript 6 modules
Summary

Book Details

ISBN 139781785880650
Paperback274 pages
Read More
From 1 reviews

Read More Reviews

Recommended for You

Object-Oriented JavaScript - Second Edition Book Cover
Object-Oriented JavaScript - Second Edition
$ 29.99
$ 21.00
Responsive Web Design with HTML5 and CSS3 Book Cover
Responsive Web Design with HTML5 and CSS3
$ 23.99
$ 4.80
JavaScript and JSON Essentials Book Cover
JavaScript and JSON Essentials
$ 17.99
$ 12.60
JavaScript Unlocked Book Cover
JavaScript Unlocked
$ 23.99
$ 16.80
Mastering Web Application Development with AngularJS Book Cover
Mastering Web Application Development with AngularJS
$ 26.99
$ 5.40
Functional Programming in JavaScript Book Cover
Functional Programming in JavaScript
$ 23.99
$ 16.80