From: Sam Stephenson <s...@37signals.com>
Date: Thu, 11 Oct 2007 12:50:08 -0500
Local: Thurs, Oct 11 2007 1:50 pm
Subject: Re: [Prototype-core] Inheritance changes
> I just saw that there were some more changes with the inheritance The changes to the class API introduced in [7833] (http://dev.rubyonrails.org/changeset/7833 > code. > I'm wondering how stable is the code. Meaning, if I start working > on a > project and use the current inheritance code right now, what > probability > is there that I'll need to rename functions (addMethods) or change > function calls (such as changing the $super construct)? ) are a result of feedback we've gotten from 1.6.0_rc0, and of numerous lengthy internal debates. Our goal was to improve the clarity of the API as well as pave the way for features that may make their way into future versions of Prototype. To that end, we've eliminated the Class.extend and Class.mixin The biggest change is that all classes (as in the objects returned by For example, in 1.6.0_rc0, where you'd write: var Foo = Class.create(); We've changed this so you now write: var Foo = Class.create(); As in 1.6.0_rc0, you can still add instance methods directly from var Foo = Class.create({ /* instance methods */ }); Also unchanged from 1.6.0_rc0, you can inherit from a superclass by var Bar = Class.create(Foo); Internally, Prototype calls addMethods on the newly created class to Finally, we've modified Class.create to take a variable number of var Bar = Class.create(Foo, Enumerable, SomeMixin, { /* instance 1.6.0_rc1 will be released very soon with these changes, and while we -sam
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| |||||||||||||||||