Links
Tags
apache
armenia
books
bsd
c
c++
chips
cinema
concurrency
cooking
database
dragonfly
erlang
filesystem
freebsd
fun
hardware
java
javascript
json
languages
linux
lyric
mac_osx
mail
math
misc
music
personal
poems
presentation
programming
python
references
ruby
rubyjs
scm
software
spiking_neural_net
study
sysadm
sysarch
technology
testing
travel
virtualization
web
wee
windows
I'm not yet sure how I will name my library which is similar to Google Web Toolkit and is based on my RubyJS. Yesterday, I implemented some DOM related stuff in under two hours. GWT uses class methods of the DOM class everywhere, e.g.:
DOM.setElementAttribute(Element elem, String attr, String value)
I don't follow this approach, because I think it's more elegant to move them into an Element class and make it an instance method instead:
el = Element.createDiv
el.setAttribute("a", "b")
The same applies to Events. This allows me to write for example:
Element['root'].appendChild(
Element.createDiv.setInnerHTML('abc').
setAttribute('title', 'tooltip'))
instead of:
root = DOM.getElementById('root')
elem = DOM.createDiv
DOM.setInnerHTML(elem, 'abc')
DOM.setElementAttribute(elem, 'title', 'tooltip')
DOM:appendChild(root, elem)
which looks much less like OO in my hence opinion.