1
0
Fork 0
Classical object-oriented framework for JavaScript [unmaintained] https://gnu.org/software/easejs
 
 
 
 
 
 
Go to file
Mike Gerwitz 3005cda543 Support for stacked mixins
The concept of stacked traits already existed in previous commits, but until
now, mixins could not be stacked without some ugly errors. This also allows
mixins to be stacked atop of themselves, duplicating their effect. This
would naturally have limited use, but it's there.

This differs slightly from Scala. For example, consider this ease.js mixin:

  C.use( T ).use( T )()

This is perfectly valid---it has the effect of stacking T twice. In reality,
ease.js is doing this:

  - C' = C.use( T );
  - new C'.use( T );

That is, it each call to `use' creates another class with T mixed in.

Scala, on the other hand, complains in this situation:

  new C with T with T

will produce an error stating that "trait T is inherited twice". You can
work around this, however, by doing this:

  class Ca extends T
  new Ca with T

In fact, this is precisely what ease.js is doing, as mentioned above; the
"use.use" syntax is merely shorthand for this:

  new C.use( T ).extend( {} ).use( T )

Just keep that in mind.
2014-03-15 21:16:27 -04:00
doc [copyright] Copyright update 2014-01-20 22:55:29 -05:00
lib Support for stacked mixins 2014-03-15 21:16:27 -04:00
test Support for stacked mixins 2014-03-15 21:16:27 -04:00
tools rmtrail now handles single-line comments following trailing comma 2014-03-07 00:47:28 -05:00
.gitignore Added test/runner to run individual test cases 2014-02-14 00:41:49 -05:00
COPYING Split COPYING into two separate files: COPYING and COPYING.LGPL 2012-06-13 22:27:48 -04:00
Makefile.am Added test/runner to run individual test cases 2014-02-14 00:41:49 -05:00
README [copyright] Copyright update 2014-01-20 22:55:29 -05:00
README.hacking Added beginning of README.hacking 2011-09-02 22:24:16 -04:00
README.md [copyright] Copyright update 2014-01-20 22:55:29 -05:00
README.todo Removed unit test refactoring mention from README.todo 2014-01-20 22:14:42 -05:00
configure.ac Added test/runner to run individual test cases 2014-02-14 00:41:49 -05:00
index.js [no-copyright] Modified headers to reduce GPL license notice width 2014-01-15 23:56:00 -05:00
package.json.in package.json is now generated by configure script and included in distribution 2013-12-22 01:05:28 -05:00

README.md

GNU ease.js

GNU ease.js is a classical object-oriented framework for Javascript, intended to eliminate boilerplate code and "ease" the transition into JavaScript from other object-oriented languages.

Current support includes:

  • Simple and intuitive class definitions
  • Classical inheritance
  • Abstract classes and methods
  • Interfaces
  • Visibility (public, protected, and private members)
  • Static and constant members

Documentation

Comprehensive documentation and examples are available on the GNU ease.js website and in its manual.

Bug Reports / Feature Requests

Please direct bug reports and feature requests to bug-easejs@gnu.org or the project page on Savannah.

Why Classical OOP in JavaScript?

GNU ease.js was created (historically) for a number of reasons:

  • To "ease" object-oriented developers into JavaScript by providing a familiar environment.
  • To provide the maintenance and development benefits of classical OOP.
  • To provide features not included in the language, such as proper encapsulation through private/protected members, interfaces, traits, intuitive inheritance, and other conveniences.
  • To encapsulate the hacks commonly used to perform the above tasks.

Many JS purists believe that classical object-oriented programming should be left out of JavaScript and that one should stick strictly to prototypal development. While the two are related (they are both object-oriented), they can be applied to different problem domains in order to achieve results that are more natural or intuitive to developers; GNU ease.js works seamlessly with existing prototypes, allowing the developer to choose whether or not they want to use "classes".

License

ease.js is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

N.B.: Versions prior to 0.2.0 were released under the LGPLv3+. Upon becoming a GNU project, it was relicensed under the GPLv3+ to help the FSF stand strong in its fight against proprietary JavaScript. For more information, please see the NEWS file (which can be built with make NEWS).