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

Quick links: > What will you learn?> Table of content> Product reviews

eBook
$5.00
RRP $35.99
Save 86%
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
$5.00
$44.99
RRP $35.99
RRP $44.99
eBook
Print + eBook

Frequently bought together


Modular Programming with JavaScript Book Cover
Modular Programming with JavaScript
$ 35.99
$ 5.00
Modern JavaScript Applications Book Cover
Modern JavaScript Applications
$ 39.99
$ 5.00
Buy 2 for $10.00
Save $65.98
Add to Cart

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

Modern JavaScript Applications Book Cover
Modern JavaScript Applications
$ 39.99
$ 5.00
Mastering JavaScript Object-Oriented Programming Book Cover
Mastering JavaScript Object-Oriented Programming
$ 35.99
$ 5.00
Node.js Design Patterns - Second Edition Book Cover
Node.js Design Patterns - Second Edition
$ 39.99
$ 5.00
Learning Vue.js 2 Book Cover
Learning Vue.js 2
$ 35.99
$ 5.00
JavaScript: Functional Programming for JavaScript Developers Book Cover
JavaScript: Functional Programming for JavaScript Developers
$ 63.99
$ 5.00
Mastering JavaScript Design Patterns - Second Edition Book Cover
Mastering JavaScript Design Patterns - Second Edition
$ 31.99
$ 5.00