Hamish Friedlander’s JQuery Concrete tries to provide a new model of code organization. It intends to be a replacement for Object Oriented Programming that is focused on adding functions to groups of DOM elements based on the content and structure of those DOM elements. This merging of the model and view layer may seem weird initially, it can give very powerful results.
Basic Usage Example
Given this DOM example:
<body>
<div class="internal_text">Internal text</div>
<div class="attribute_text" rel="Attribute text"></div>
<div>some text</div>
</body>And this concrete function:
$('.internal_text').concrete({
foo: function(){ console.log(this.text()); }
});
$('.attribute_text').concrete({
foo: function(){ console.log(this.attr('rel')); }
});Then the following call:
$('div').foo();The following result will be logged to the console:
Internal text Attribute text
We’re standing on the shoulders of giants here – combining ideas from Prototype’s behaviour & lowpro and jQuery’s effen & livequery (who themselves stole ideals from Self’s Morphic UI and others), but extending & combining the concepts presented in those tools to provide a complete alternative to traditional OO concepts – self-aware methods, inheritance, polymorphisim and namespacing without a single class definition.
