Skip to main content
replaced http://programmers.stackexchange.com/ with https://softwareengineering.stackexchange.com/
Source Link

When you have a base object that you then create modified copies of, you are using the Prototype pattern. The original object (the Fruit in this case) serves as a prototypical template from which you build your individual fruits. Because they all derive from the original Fruit class, they have a prototypical inheritance relationship (as originally noted by @coredump@coredump).

You don't specify what language you are using, but Javascript is built entirely using the prototypical model rather than the classical model for inheritance.

When you have a base object that you then create modified copies of, you are using the Prototype pattern. The original object (the Fruit in this case) serves as a prototypical template from which you build your individual fruits. Because they all derive from the original Fruit class, they have a prototypical inheritance relationship (as originally noted by @coredump).

You don't specify what language you are using, but Javascript is built entirely using the prototypical model rather than the classical model for inheritance.

When you have a base object that you then create modified copies of, you are using the Prototype pattern. The original object (the Fruit in this case) serves as a prototypical template from which you build your individual fruits. Because they all derive from the original Fruit class, they have a prototypical inheritance relationship (as originally noted by @coredump).

You don't specify what language you are using, but Javascript is built entirely using the prototypical model rather than the classical model for inheritance.

Source Link
cbojar
  • 4.3k
  • 1
  • 20
  • 19

When you have a base object that you then create modified copies of, you are using the Prototype pattern. The original object (the Fruit in this case) serves as a prototypical template from which you build your individual fruits. Because they all derive from the original Fruit class, they have a prototypical inheritance relationship (as originally noted by @coredump).

You don't specify what language you are using, but Javascript is built entirely using the prototypical model rather than the classical model for inheritance.