Mastering JavaScript Design Patterns - Second Edition by Simon Timms
Author:Simon Timms [Timms, Simon]
Language: eng
Format: azw3, epub, pdf
Publisher: Packt Publishing
Published: 2016-06-29T04:00:00+00:00
Lazy instantiation
If you go into a higher-end coffee shop and place an order for some overly complex beverage (Grande Chai Tea Latte, 3 Pump, Skim Milk, Lite Water, No Foam, Extra Hot anybody?) then that beverage is going to be made on-the-fly and not in advance. Even if the coffee shop knew which orders were going to come in that day, they would still not make all the beverages up front. First, because it would result in a large number of ruined, cold beverages, and second, it would be a very long time for the first customer to get their order if they had to wait for all the orders of the day to be completed.
Instead coffee shops follow a just-in-time approach to crafting beverages. They make them when they're ordered. We can apply a similar approach to our code through the use of a technique known as lazy instantiation or lazy initialization.
Consider an object which is expensive to create; that is to say that it takes a great deal of time to create the object. If we are unsure if the object's value will be needed, we can defer its full creation until later.
Download
Mastering JavaScript Design Patterns - Second Edition by Simon Timms.epub
Mastering JavaScript Design Patterns - Second Edition by Simon Timms.pdf
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Hello! Python by Anthony Briggs(9351)
The Mikado Method by Ola Ellnestam Daniel Brolund(9288)
Dependency Injection in .NET by Mark Seemann(8836)
Sass and Compass in Action by Wynn Netherland Nathan Weizenbaum Chris Eppstein Brandon Mathis(7385)
The Well-Grounded Java Developer by Benjamin J. Evans Martijn Verburg(7097)
Secrets of the JavaScript Ninja by John Resig & Bear Bibeault(6233)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(5933)
Jquery UI in Action : Master the concepts Of Jquery UI: A Step By Step Approach by ANMOL GOYAL(5496)
Kotlin in Action by Dmitry Jemerov(4617)
Audition by Ryu Murakami(4076)
Hands-On Full-Stack Web Development with GraphQL and React by Sebastian Grebe(3778)
Functional Programming in JavaScript by Mantyla Dan(3712)
Learning React: Functional Web Development with React and Redux by Banks Alex & Porcello Eve(2822)
Svelte with Test-Driven Development by Daniel Irvine(2568)
Architecting Modern Java EE Applications: Designing lightweight, business-oriented enterprise applications in the age of cloud, containers, and Java EE 8 by Daschner Sebastian(2547)
WordPress Plugin Development Cookbook by Yannick Lefebvre(2524)
React Native - Building Mobile Apps with JavaScript by Novick Vladimir(2326)
Layered Design for Ruby on Rails Applications by Dementyev Vladimir;(2224)
PHP 7 Data Structures and Algorithms by Mizanur Rahman(2194)