Skip to content

Commit

Permalink
Updated README
Browse files Browse the repository at this point in the history
  • Loading branch information
chubas committed Jun 23, 2012
1 parent 8bb035c commit 595f707
Showing 1 changed file with 38 additions and 35 deletions.
73 changes: 38 additions & 35 deletions README.rdoc → README.markdown
@@ -1,50 +1,53 @@
= JavaScript DSL for Classical Inheritance = Neon

== JavaScript DSL for Classical Inheritance


This files provides a DSL for the following design patterns: This files provides a DSL for the following design patterns:


* inheritance * inheritance
* interface * interface
* module * module


It also provides a DSL for class creation. Neon packs a DSL for Class creation, that helps in making programs following an object oriented design.


The phylosophy is that it should not try to emulate other languages, and it preserves the JavaScript good parts, but with a nicer syntax to create classes that ensure interfaces and include reusable functionality as modules. The philosophy is that it should not try to emulate other languages, so it preserves the JavaScript good parts,
but with a nicer syntax to create classes that ensure interfaces and include reusable functionality as modules.


=== Usage === Usage


Interface('Editable')({ Interface('Editable')({
constructor : ['x'], constructor : ['x'],
prototype : ['x'] prototype : ['x']
}); });


Module('Composition')({ Module('Composition')({
y : 5, y : 5,
prototype : { prototype : {
z : 3 z : 3
} }
}); });


Module('Other')({ Module('Other')({
a : 5, a : 5,
prototype : { prototype : {
b : 3 b : 3
}
});

Class('Overlay').inherits(Widget).ensures(Editable).includes(Composition, Other)({
html : '<div></div>',
prototype : {
init : function (element){
if(!element){
element = document.createElement('div');
element.innerHTML = 'hola';
document.body.appendChild(element);
} }
}, });
b : 5
} Class('Overlay').inherits(Widget).ensures(Editable).includes(Composition, Other)({
}); html : '<div></div>',

prototype : {
init : function (element){
if(!element){
element = document.createElement('div');
element.innerHTML = 'hello';
document.body.appendChild(element);
}
},
b : 5
}
});

== License == License


Copyright (c) 2009 Fernando Trasviña Copyright (c) 2009 Fernando Trasviña
Expand Down

0 comments on commit 595f707

Please sign in to comment.