Difference between revisions of "Prototype"
(intro from pedia) |
m |
||
Line 1: | Line 1: | ||
{{glossary}} | {{glossary}} | ||
− | [[w:Prototype-based programming|Prototype-based programming]] is a style of [[w:object-oriented programming|object-oriented programming]] in which [[w:class (programming)|classes]] are not present, and behaviour reuse (known as [[w:inheritance (programming)|inheritance]] in class-based languages) is performed via a process of [[w:cloning (programming)|cloning]] existing [[w:object (programming)|object]]s that serve as [[w:prototype]]s. This model can also be known as ''classless'', ''prototype-oriented'' or ''instance-based'' programming. [[w:delegation (programming)|Delegation]] is the language feature that supports prototype-based programming. | + | [[w:Prototype-based programming|Prototype-based programming]] is a style of [[w:object-oriented programming|object-oriented programming]] in which [[w:class (programming)|classes]] are not present, and behaviour reuse (known as [[w:inheritance (programming)|inheritance]] in class-based languages) is performed via a process of [[w:cloning (programming)|cloning]] existing [[w:object (programming)|object]]s that serve as [[w:Prototype|prototype]]s. This model can also be known as ''classless'', ''prototype-oriented'' or ''instance-based'' programming. [[w:delegation (programming)|Delegation]] is the language feature that supports prototype-based programming. |
The original, and most canonical, example of a prototype-based language is the programming language [[Self]]. Since the late 1990s, the classless programming style has grown increasingly popular, and has been adopted for the languages [[w:JavaScript|JavaScript]], [[w:ActionScript|ActionScript]], [[w:Cecil (programming language)|Cecil]], [[w:NewtonScript|NewtonScript]], [[w:Io (programming language)|Io]], [[w:MOO (programming language)|MOO]], [[w:REBOL|REBOL]], [[w:Lisaac|Lisaac]], [[w:Lua (programming language)|Lua]] and several others. | The original, and most canonical, example of a prototype-based language is the programming language [[Self]]. Since the late 1990s, the classless programming style has grown increasingly popular, and has been adopted for the languages [[w:JavaScript|JavaScript]], [[w:ActionScript|ActionScript]], [[w:Cecil (programming language)|Cecil]], [[w:NewtonScript|NewtonScript]], [[w:Io (programming language)|Io]], [[w:MOO (programming language)|MOO]], [[w:REBOL|REBOL]], [[w:Lisaac|Lisaac]], [[w:Lua (programming language)|Lua]] and several others. |
Revision as of 22:54, 25 January 2011
Prototype-based programming is a style of object-oriented programming in which classes are not present, and behaviour reuse (known as inheritance in class-based languages) is performed via a process of cloning existing objects that serve as prototypes. This model can also be known as classless, prototype-oriented or instance-based programming. Delegation is the language feature that supports prototype-based programming.
The original, and most canonical, example of a prototype-based language is the programming language Self. Since the late 1990s, the classless programming style has grown increasingly popular, and has been adopted for the languages JavaScript, ActionScript, Cecil, NewtonScript, Io, MOO, REBOL, Lisaac, Lua and several others.
Prototype / Archetype
The Nodal Model combines these two concepts, since instances are based on prototypes, but the prototypes evolve over time from feedback from the instances "in the field". This is a tangled hierarchy where each is based on the other, but as with all such "paradoxes" found in such systems they are resolved by each direction of influence operating on a different scale of time - i.e. local instances maintain a dynamic real-time relationship with the global prototype which changes very slowly as the information from many instances is collated and assessed.