首页| JavaScript| HTML/CSS| Matlab| PHP| Python| Java| C/C++/VC++| C#| ASP| 其他|
购买积分 购买会员 激活码充值

您现在的位置是:虫虫源码 > JavaScript > JavaScript的面向对象风格的红宝石

JavaScript的面向对象风格的红宝石

资 源 简 介

Inheritance.js Inheritance.js is a plugin for the Prototype Javascript library that provides developers with a complete, unobtrusive, Ruby inspired, classical inheritance model. Using Inheritance.js, developers are given the power to easily define classes, sub-classes, and mix-ins, with a sprinkle of syntax sugar. The process of overriding methods is simplified; Inheritance.js uses a properly scoped parent method that is made available only inside an overriding method. To top it off, Inheritance.js accomplishes all this without adding any additional properties or methods to the developer"s instantiated objects. ``` Person = Class.extend({ // adding a mixin include: Sortable, // initializer function initialize: function(name) { this.name = name; }, // ... methods ... toString: function() { return this.name; } }); Employee = Class.extend(Person, { // adding mixins include: [Sortable, OtherModule]

文 件 列 表

inheritance-2.7
dist
doc
LICENSE
._Rakefile
Rakefile
src
test
vendor
VIP VIP
0.182476s