Mastering JavaScript Object-Oriented Programming

Unleash the true power of JavaScript by mastering Object-Oriented programming principles and patterns
Preview in Mapt

Mastering JavaScript Object-Oriented Programming

Andrea Chiarelli

2 customer reviews
Unleash the true power of JavaScript by mastering Object-Oriented programming principles and patterns

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


Mastering JavaScript Object-Oriented Programming Book Cover
Mastering JavaScript Object-Oriented Programming
$ 35.99
$ 5.00
Learning Vue.js 2 Book Cover
Learning Vue.js 2
$ 35.99
$ 5.00
Buy 2 for $10.00
Save $61.98
Add to Cart

Book Details

ISBN 139781785889103
Paperback292 pages

Book Description

ECMAScript 6 introduces several new Object-Oriented features that drastically change the way developers structure their projects. Web developers now have some advanced OOP functionality at their disposal to build large-scale applications in JavaScript.

With this book, we'll provide you with a comprehensive overview of OOP principles in JavaScript and how they can be implemented to build sophisticated web applications. Kicking off with a subtle refresher on objects, we'll show you how easy it is to define objects with the new ES6 classes. From there, we'll fly you through some essential OOP principles, forming a base for you to get hands-on with encapsulation.

You'll get to work with the different methods of inheritance and we'll show you how to avoid using inheritance with Duck Typing. From there, we'll move on to some advanced patterns for object creation and you'll get a strong idea of how to use interesting patterns to present data to users and to bind data. We'll use the famous promises to work with asynchronous processes and will give you some tips on how to organize your code effectively.

You'll find out how to create robust code using SOLID principles and finally, we'll show you how to clearly define the goals of your application architecture to get better, smarter, and more effective coding. This book is your one-way ticket to becoming a JavaScript Jedi who can be counted on to deliver flexible and maintainable code.

Table of Contents

Chapter 1: A Refresher of Objects
Object literals
Object constructors
Object prototypes
Using classes
Summary
Chapter 2: Diving into OOP Principles
OOP principles
Is JavaScript Object Oriented?
Abstraction and modeling support
OOP principles support
JavaScript OOP versus classical OOP
Summary
Chapter 3: Working with Encapsulation and Information Hiding
Encapsulation and information hiding
Convention-based approach
Privacy levels using closure
A meta-closure approach
Property descriptors
Information hiding in ES6 classes
Summary
Chapter 4: Inheriting and Creating Mixins
Why inheritance?
Objects and prototypes
ES6 inheritance
Controlling inheritance
Implementing multiple inheritance
Creating and using mixins
Summary
Chapter 5: Defining Contracts with Duck Typing
Managing dynamic typing
Contracts and interfaces
Duck typing
Duck typing and polymorphism
Summary
Chapter 6: Advanced Object Creation
Creating objects
Design patterns and object creation
Creating a singleton
An object factory
The builder pattern
Comparing factory and builder patterns
Recycling objects with an object pool
Summary
Chapter 7: Presenting Data to the User
Managing user interfaces
Presentation patterns
The Model-View-Controller pattern
The Model-View-Presenter pattern
The Model-View-ViewModel pattern
A MV* pattern comparison
Summary
Chapter 8: Data Binding
What is data binding?
Implementing data binding
The publish/subscribe pattern
Using proxies
Summary
Chapter 9: Asynchronous Programming and Promises
Is JavaScript asynchronous?
Writing asynchronous code
Introducing Promises
Using Generators
Summary
Chapter 10: Organizing Code
The global scope
Creating namespaces
The module pattern
Module loading
ECMAScript 6 modules
Summary
Chapter 11: SOLID Principles
Principle of OOP design
The Single Responsibility Principle
The Open/Closed Principle
The Liskov Substitution Principle
The Interface Segregation Principle
The Dependency Inversion Principle
Summary
Chapter 12: Modern Application Architectures
From scripts to applications
From old-style to Single Page Applications
The Zakas/Osmani architecture
Cross-cutting features and AOP
Isomorphic applications
Summary

What You Will Learn

  • Master JavaScript's OOP features, including the one's provided by ES6 specification
  • Identify and apply the most common design patterns such as Singleton, Factory, Observer, Model-View-Controller, and Mediator Patterns
  • Understand the SOLID principles and their benefits
  • Use the acquired OOP knowledge to build robust and maintainable code
  • Design applications using a modular architecture based on SOLID principles

Authors

Table of Contents

Chapter 1: A Refresher of Objects
Object literals
Object constructors
Object prototypes
Using classes
Summary
Chapter 2: Diving into OOP Principles
OOP principles
Is JavaScript Object Oriented?
Abstraction and modeling support
OOP principles support
JavaScript OOP versus classical OOP
Summary
Chapter 3: Working with Encapsulation and Information Hiding
Encapsulation and information hiding
Convention-based approach
Privacy levels using closure
A meta-closure approach
Property descriptors
Information hiding in ES6 classes
Summary
Chapter 4: Inheriting and Creating Mixins
Why inheritance?
Objects and prototypes
ES6 inheritance
Controlling inheritance
Implementing multiple inheritance
Creating and using mixins
Summary
Chapter 5: Defining Contracts with Duck Typing
Managing dynamic typing
Contracts and interfaces
Duck typing
Duck typing and polymorphism
Summary
Chapter 6: Advanced Object Creation
Creating objects
Design patterns and object creation
Creating a singleton
An object factory
The builder pattern
Comparing factory and builder patterns
Recycling objects with an object pool
Summary
Chapter 7: Presenting Data to the User
Managing user interfaces
Presentation patterns
The Model-View-Controller pattern
The Model-View-Presenter pattern
The Model-View-ViewModel pattern
A MV* pattern comparison
Summary
Chapter 8: Data Binding
What is data binding?
Implementing data binding
The publish/subscribe pattern
Using proxies
Summary
Chapter 9: Asynchronous Programming and Promises
Is JavaScript asynchronous?
Writing asynchronous code
Introducing Promises
Using Generators
Summary
Chapter 10: Organizing Code
The global scope
Creating namespaces
The module pattern
Module loading
ECMAScript 6 modules
Summary
Chapter 11: SOLID Principles
Principle of OOP design
The Single Responsibility Principle
The Open/Closed Principle
The Liskov Substitution Principle
The Interface Segregation Principle
The Dependency Inversion Principle
Summary
Chapter 12: Modern Application Architectures
From scripts to applications
From old-style to Single Page Applications
The Zakas/Osmani architecture
Cross-cutting features and AOP
Isomorphic applications
Summary

Book Details

ISBN 139781785889103
Paperback292 pages
Read More
From 2 reviews

Read More Reviews

Recommended for You

Learning Vue.js 2 Book Cover
Learning Vue.js 2
$ 35.99
$ 5.00
JavaScript Concurrency Book Cover
JavaScript Concurrency
$ 35.99
$ 5.00
JavaScript: Functional Programming for JavaScript Developers Book Cover
JavaScript: Functional Programming for JavaScript Developers
$ 63.99
$ 5.00
Javascript: Object Oriented Programming Book Cover
Javascript: Object Oriented Programming
$ 63.99
$ 5.00
Object-Oriented JavaScript - Second Edition Book Cover
Object-Oriented JavaScript - Second Edition
$ 29.99
$ 5.00
React Components Book Cover
React Components
$ 27.99
$ 5.00