Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/icarusso/znow
https://github.com/icarusso/znow
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/icarusso/znow
- Owner: IcarusSO
- Created: 2014-12-26T07:11:18.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2015-06-10T13:49:04.000Z (over 9 years ago)
- Last Synced: 2024-11-03T08:06:37.330Z (3 months ago)
- Language: JavaScript
- Size: 12.2 MB
- Stars: 3
- Watchers: 3
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
ZNOW
====
Although JavaScript supports object-oriented programming, it is in prototype-based form. ZNOW is a framework allows programmers to write JavaScript in class-based object oriented style. Use prototype or class-based style is the option of the programmer, and not be restricted by the language itself anymore.
http://icarusso.github.io/ZNOWEncapsulation
---
```
var ClasA=Class({
getA1:function(){
return this._a;
},
_a:'a1'
})
var ClassA2=Class.extends(ClassA)({
getA2:function(){
return this._a
},
_a:'a2'
})var obj=new ClassA2();
obj.getA1(); //> a1
obj.getA2(); //> a2
obj._a; //> Undefined
```Abstraction
---
```
var BaseA=Class({
foo:ABSTRACT()
})
var ConcreteA=Class.extends(BaseA)({
foo:function(){
return true;
}
})
var BA=new BaseA(); //> Throw error
var CA=new ConcreteA();
```Inheritance
---
```
var ClassA=Class({
foo1:function(){
return 'foo1';
},
$foo2:function(){
return 'foo2';
}
})
var ClassB=Class.extends(ClassA)({
foo3:function(){
return this.super.$foo2() + 'foo3';
}
})
```
http://icarusso.github.io/ZNOW