Popular Searches

download information for Search Optimization  Search Optimization
download information for Search Engine  Search Engine
download information for Adsense  Adsense
download information for RSS  RSS
download information for Blog  Blog
download information for Compression  Compression
download information for Audio  Audio
download information for Video  Video
download information for XML  XML
download information for Screensaver  Screensaver
download information for CSS  CSS
download information for Backup  Backup
download information for Software  Software
download information for Spyware  Spyware



Tags

design pattern javascript computer designates postponed linking object prototype needed properly approach increase efficiency simplicity written called moment instance creation



Web Matches



A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X  Y  Z

Search Articles e.g. mp4
 

Lazy Inheritance

Lazy inheritance is a design pattern used in JavaScript computer programming.

It designates a postponed linking of an object with its prototype (class) until it is needed. If used properly, such approach may increase efficiency, simplicity and flexibility of OOP-based code written using JavaScript.

Since lazy inheritance called only once at the moment of first object instance creation, it seems logical to unite process of class prototype creation with resolving necessary dependencies of that class.

The instances of objects in lazy inheritance are created in "mixed" mode - on first invocation, a factory is used to modify class prototype which is later is used for subsequent object instances creation. In other words, the process of prototype construction also allows loading scripts (if ones were not loaded before) which specific class depends on.

Such approach to inheritance support has the following benefits:

Lazy inheritance has the same benefits as classical JavaScript prototype features;

It is not necessary to maintain proper order of script files declaration;

In most cases, HTML page which contains JavaScript is loaded faster since there are no objects created during page initialization and since some scripts could be loaded only at the moment in which they are actually necessary (they are necessary if the caller code during it's execution really creates instances of corresponding classes);

Dependencies are declared in more explicit way and class depends only on concrete scripts; Moreover, it's not necessary to artificially group specific scripts into modules and define dependencies between such modules;

If lazy mode of scripts loading is used, only necessary scripts (which are actually required for application functionality) will be loaded. If, for example, some HTML page may operate in different modes, like "read-write" and "read-only", for every mode required scripts will be loaded and this will be performed automatically without manual script loading optimization.



Related Ads



Add to Google Add to Yahoo Add to Furl  Add to del.icio.us  Add to DIGG

Resource: Part or all of the information provided in this section is brought to you via wikipedia and other similar sites. Please repsect their licenses and for more information visit the homepages of these sites.

Links
Freeware Downloads Download Information RGB Hex Converter Web Colors
Home  Link to Us
Copyright © iFreeware Downloads 2005-2012
All rights reserved