background preloader

Framework

Facebook Twitter

CodeIgniter - Open source PHP web application framework. Picora : PHP Micro Framework. A Base Class for JavaScript Inheritance. NB. I’ve amended the code samples below to reflect recent changes in this class. I’m an OO programmer at heart and JavaScript supports prototype based inheritance.

Unfortunatley this leads to verbose class definitions: function Animal(name) {}; Animal.prototype.eat = function() {}; Animal.prototype.say = function(message) {}; I want a nice base class for JavaScript OO: I want to easily create classes without the MyClass.prototype cruft I want method overriding with intuitive access to the overridden method (like Java’s super) I want to avoid calling a class’ constructor function during the prototyping phase I want to easily add static (class) properties and methods I want to achieve the above without resorting to global functions to build prototype chains I want to achieve the above without affecting Object.prototype The Base Class I’ve created a JavaScript class (Base.js) that I hope eases the pain of JavaScript OO.

The Base class defines two instance methods: extend base Creating Classes. UI Library (YUI) Symfony.