ease.js - Tasks: task #12102, Traits/Mixins
You are not allowed to post comments on this tracker with your current authentication level.
task #12102: Traits/Mixins
Submitter: | Mike Gerwitz <mikegerwitz> | ||
Submitted: | Sun 10 Jun 2012 03:46:28 AM UTC | ||
Should Start On: | Mon 20 Jan 2014 05:00:00 AM UTC | Should be Finished on: | Thu 01 Oct 2015 04:00:00 AM UTC |
Category: | Core | Priority: | 9 - Immediate |
Item Group: | Development | Status: | In Progress |
Privacy: | Public | Assigned to: | mikegerwitz |
Percent Complete: | 80% | Open/Closed: | Open |
Planned Release: | 0.3.0 | ||
Keywords: | traits, mixins |
Sat 08 Feb 2014 05:52:00 AM UTC, comment #5: [Additional Information] |
Mike Gerwitz <mikegerwitz> |
Mon 27 Jan 2014 05:35:18 AM UTC, comment #4: The implementation described below has proven to be effective and relatively clean, resulting in functional traits. I now must deal with the finer details, ensuring that it cooperates consistently and cleanly with the remainder of the framework. In particular, it presents interesting approaches for ensuring the proper implementation of overriding virtual concrete methods defined in traits, creating subtypes of classes using traits, ensuring property access of class and trait members are consistent in pre-ES5 implementations, and others.
|
Mike Gerwitz <mikegerwitz> |
Wed 22 Jan 2014 07:17:09 PM UTC, comment #3: [Additional Information] #13054 sheds some more light on the complexity of implementing traits as the merging of the trait definition objects with the class's definition object. I feel that we may be able to simplify this implementation (at least for the majority of [sane] use cases) by treating traits as a special type of abstract class (which is a route I had originally wanted to explore) and treating mix-ins (both during class definition and instantiation, but we're focusing on the former at the moment) as composition via proxying (that is, in the sense of the `proxy' keyword).
|
Mike Gerwitz <mikegerwitz> |
Wed 22 Jan 2014 06:09:09 AM UTC, comment #2: See #13054.
|
Mike Gerwitz <mikegerwitz> |
Tue 21 Jan 2014 04:03:31 AM UTC, comment #1: [Additional Information] Good news---this feature will provide what I see as a clean implementation of events completely separate from the ease.js core, so I will begin development on traits/mixins immediately. |
Mike Gerwitz <mikegerwitz> |
Sun 10 Jun 2012 03:46:28 AM UTC, original submission:
Title says it all. Implementation details will be decided after v0.2.0 release.
|
Mike Gerwitz <mikegerwitz> |
No files currently attached
Depends on the following items: None found
Items that depend on this one: None found
There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.
Follow 13 latest changes.
Date | Changed by | Updated Field | Previous Value | => | Replaced by |
---|---|---|---|---|---|
2015-05-20 | mikegerwitz | Should be Finished on | 2014-02-15 | 2015-10-01 | |
Percent Complete | 70% | 80% | |||
Planned Release | 0.2.0 | 0.3.0 | |||
2014-02-08 | mikegerwitz | Percent Complete | 50% | 70% | |
2014-01-27 | mikegerwitz | Percent Complete | 20% | 50% | |
2014-01-23 | mikegerwitz | Percent Complete | 0% | 20% | |
2014-01-22 | mikegerwitz | Dependencies | Removed dependency to task #13054 | - | |
2014-01-22 | mikegerwitz | Dependencies | - | Depends on task #13054 | |
2014-01-21 | mikegerwitz | Should Start On | 2013-01-01 | 2014-01-20 | |
Should be Finished on | 2013-03-01 | 2014-02-15 | |||
Priority | 7 - High | 9 - Immediate | |||
2014-01-21 | mikegerwitz | Status | None | In Progress | |
Planned Release | None | 0.2.0 |
Powered by Savane 3.13-4448.
Corresponding source code
I'd like to make a correction to my previous comment with regards to how Scala implements traits; I had incorrectly recalled my past experience with the language. Scala does not have any implicit ordering: indeed, you must specify separate mixins using the "with" keyword for each, which resolves all ambiguities and ensures that the supertype is always well-defined.
This will not be necessary with ease.js, but can be done if multiple traits result in ambiguities, since ease.js will not provide conflict resolution (rationale will be in documentation and test cases). For example, if Ta and Tb both attempt to override the same method, ease.js would throw an error; however, if C mixed in Ta and then C' extended C and mixed in Tb, the ambiguity will have been resolved.