Announcing Concrete - a jQuery library for structured code development

2 views
Skip to first unread message

Hamish Friedlander

unread,
Oct 15, 2009, 4:29:23 PM10/15/09
to silverst...@googlegroups.com
Hi,

I'd like to announce the 0.9 (API stable) release of the Concrete and Selector libraries for jQuery. Concrete is in use in several projects internally, and is a key component of the JavaScript Refactoring announced by Ingo.

Concrete provides a brand new model of javascript code organisation – a replacement for Object Oriented programming that is focused on adding functions to DOM elements based on their structure and content. It’s a merging of the model and view layer that initially seems weird, but can give very powerful results.

We’re taking ideas from Prototype’s behaviour & lowpro and jQuery’s effen & livequery, but extending these concepts to provide a complete alternative to traditional OO design - self-aware methods, inheritance, polymorphism, constructors and destructors, namespacing and getter/setter style properties, all without a single class definition.

Compared to jQuery.plugins and jQuery.UI widgets, Concrete provides:

 * code clarity - the code structure leads to more readable code
 * extensibility - specificity based method selection allows the injection of logic almost anywhere without monkey patching
 * greater organisational capabilities - syntax promotes modularity
 * reduced name clashes - powerful refactoring-free namespacing eliminates name pollution

A key component of Concrete is Selector - a css selector engine developed in conjunction with Concrete to give it maximum performance. For the use patterns is it designed for, it can out-perform jQuery's native Sizzle selector engine by an order of magnitude.

A taste:

$('div').concrete({
highlight: function(){ 
this.effect('bounce');
}
});

$('div.important').concrete({
highlight: function(){ 
this._super();
this.animate({background: 'white'});
}
});

$('#namediv').highlight();

As well as the source, a tutorial and a screencast are available to help introduce the new concepts. In addition to the work taking place on the JavaScript Refactoring branch, you can also see (a slightly outdated version of) Concrete in use in the PromoSpots module.

Hamish Friedlander

Simon J Welsh

unread,
Oct 15, 2009, 5:37:29 PM10/15/09
to silverst...@googlegroups.com
Is it just me, or is this missing links?

---
Simon Welsh
Admin of http://simon.geek.nz/

Who said Microsoft never created a bug-free program? The blue screen
never, ever crashes!

http://www.thinkgeek.com/brain/gimme.cgi?wid=81d520e5e

Sigurd Magnusson

unread,
Oct 15, 2009, 5:43:59 PM10/15/09
to silverst...@googlegroups.com
I had links; your reply didn't. How odd!

> --~--~---------~--~----~------------~-------~--~----~
> You received this message because you are subscribed to the Google
> Groups "SilverStripe Development" group.
> To post to this group, send email to silverst...@googlegroups.com
> To unsubscribe from this group, send email to silverstripe-d...@googlegroups.com
> For more options, visit this group at http://groups.google.com/group/silverstripe-dev?hl=en

Hamish Friedlander

unread,
Oct 15, 2009, 5:48:11 PM10/15/09
to silverst...@googlegroups.com

Is it just me, or is this missing links?

They came through for me, but I did use HTML email, which is just a little bit bad of me. Here's the announcement again with the links separated out.

I'd like to announce the 0.9 (API stable) release of the Concrete (http://github.com/hafriedlander/jquery.concrete) and Selector (http://github.com/hafriedlander/jquery.selector) libraries for jQuery. Concrete is in use in several projects internally, and is a key component of the JavaScript Refactoring (http://groups.google.com/group/silverstripe-dev/browse_thread/thread/500f6b53b7a7d99f/9c544b8ff54bca72) announced by Ingo.

Concrete provides a brand new model of javascript code organisation – a replacement for Object Oriented programming that is focused on adding functions to DOM elements based on their structure and content. It’s a merging of the model and view layer that initially seems weird, but can give very powerful results.

We’re taking ideas from Prototype’s behaviour & lowpro and jQuery’s effen & livequery, but extending these concepts to provide a complete alternative to traditional OO design - self-aware methods, inheritance, polymorphism, constructors and destructors, namespacing and getter/setter style properties, all without a single class definition.

Compared to jQuery.plugins and jQuery.UI widgets, Concrete provides:

 * code clarity - the code structure leads to more readable code
 * extensibility - specificity based method selection allows the injection of logic almost anywhere without monkey patching
 * greater organisational capabilities - syntax promotes modularity
 * reduced name clashes - powerful refactoring-free namespacing eliminates name pollution

A key component of Concrete is Selector - a css selector engine developed in conjunction with Concrete to give it maximum performance. For the use patterns is it designed for, it can out-perform jQuery's native Sizzle selector engine by an order of magnitude.

A taste:

$('div').concrete({
highlight: function(){ 
this.effect('bounce');
}
});

$('div.important').concrete({
highlight: function(){ 
this._super();
this.animate({background: 'white'});
}
});

$('#namediv').highlight();

As well as the source (http://github.com/hafriedlander/jquery.concrete), a tutorial (http://hafriedlander.github.com/jquery.concrete/tutorial/) and a screencast (http://www.vimeo.com/6353390) are available to help introduce the new concepts. In addition to the work taking place on the JavaScript Refactoring (http://github.com/chillu/cms/tree/jsrewrite) branch, you can also see (a slightly outdated version of) Concrete in use in the PromoSpots (http://open.silverstripe.com/browser/modules/promospots/trunk) module.

Hamish Friedlander

Mat Weir

unread,
Oct 15, 2009, 10:30:25 PM10/15/09
to silverst...@googlegroups.com
Looks fun, I'm going to start using it in an app next week.

Before I dive into it, does it behave the same as jQuery live? Or can it play nicely with live?

Mat Weir
Xebidy Social Web Design
http://xebidy.com

Hamish Friedlander

unread,
Oct 15, 2009, 10:45:26 PM10/15/09
to silverst...@googlegroups.com

On 16/10/2009, at 3:30 PM, Mat Weir wrote:

> Looks fun, I'm going to start using it in an app next week.
>
> Before I dive into it, does it behave the same as jQuery live? Or
> can it play nicely with live?
>

It should play nicely with live (and even livequery, although I don't
recommend it). The event handling is similar to live + the live-
extensions plugin (so you can use onchange, onsubmit, etc).

Steps 2, 3 and 4 of the tutorial cover the subtleties

http://hafriedlander.github.com/jquery.concrete/tutorial/step_02.html
http://hafriedlander.github.com/jquery.concrete/tutorial/step_03.html
http://hafriedlander.github.com/jquery.concrete/tutorial/step_04.html

Hamish Friedlander
SilverStripe

Pete Bacon Darwin

unread,
Oct 16, 2009, 4:23:38 AM10/16/09
to silverst...@googlegroups.com

This looks very powerful.  Two questions:

·         Why is it called concrete?  I am probably missing something obvious but a more descriptive name especially for the method call “concrete(...)” would seem to be more helpful.

·         I would have thought that this sort of ability should be built into jquery core.  Have you collaborated with the jquery team when developing this?

Pete


 

No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.5.421 / Virus Database: 270.14.14/2433 - Release Date: 10/15/09 12:02:00

Hamish Friedlander

unread,
Oct 16, 2009, 9:38:39 PM10/16/09
to silverst...@googlegroups.com

On 16/10/2009, at 9:23 PM, Pete Bacon Darwin wrote:

> This looks very powerful. Two questions:
> · Why is it called concrete? I am probably missing
> something obvious but a more descriptive name especially for the
> method call “concrete(...)” would seem to be more helpful.

The technique the library is based around is called 'Concrete UI'. I
wanted a name that was short(ish), unlikely to clash with any other
library (which ruled out bind, attach, methods, etc), or suggest
metaphors that are either inaccurate or confusing (i.e. klass)

Feel free to suggest a better method name if you like. If there's a
community consensus on a better name (and I like it :), I'll alias
them for 1.0, and deprecate the original concrete method call for
whatever version comes after.

> · I would have thought that this sort of ability should be

> built into jquery core. Have you collaborated with the jquery team
> when developing this?

No. I'd be happy if they included it, but I doubt it's going to
happen. They're understandably wary of putting anything in regular
jQuery unless it's both small, universally useful, and focused on
making DOM manipulation easy. Hence why jQuery UI is a separate
library, and even things like color animation, json, class
construction and other things are plugins.

Having said that, once I've gotten this to 1.0, I'll be looking at
reducing the footprint of the selector code and seeing whether it's a
good candidate for integration. I'm also hoping to get this seen as
the de facto third part in the jQuery chain - jQuery for all sites,
jQuery.UI for complex sites, jQuery.Concrete for web applications -
but that'll depend a lot on community acceptance.

Hamish Friedlander
SilverStripe

ham...@silverstripe.com

unread,
Nov 18, 2009, 3:41:14 PM11/18/09
to SilverStripe Development
Just to let people who aren't following the jQuery Concrete group
know, there's currently a vote going on there to pick a new name (a
trademark holder has politely requested I change names to avoid
confusion).

You can see the suggestions, read the ridiculously complicated voting
rules and even participate in the vote (although you'll need to join
the group for that last one) at http://groups.google.com/group/jquery-concrete/t/c62dd699f3fe2e83

Hamish Friedlander
SilverStripe
Reply all
Reply to author
Forward
0 new messages