Monday 20 January 2014

Javascript : Prototype based programming

Prototype-based programming:
Prototype-based programming is a style of doing programming like object-oriented programming
in which instead of classes functions are present, and function's behavior reuse
is accomplished through a process of decorating existing objects which serve as prototypes.
This model is also known as prototype-oriented, or instance-based programming.

Advantage :
- Re-usability
- can maintain large number of classes with less code
- Multiple inheritance is easy
- can change behavior at runtime

Example :


No comments:

Post a Comment