mercredi 1 février 2017

Javascript oop object pool pattern [on hold]

In this code example there is a way to implement the object pool pattern?

An example in php and java

// parents
function Parent() {
  this.id = 'Parent';
}

// childs
function Child1() {
  Parent.call(this);
  this.id = 'Child1';
  this.name = 'Mario';
}
Child1.prototype = Object.create(Parent.prototype);

function Child2() {
  Parent.call(this);
  this.id = 'Child2';
  this.name = 'Luigi';
}
Child2.prototype = Object.create(Parent.prototype);

Aucun commentaire:

Enregistrer un commentaire