Announcing the release of Concrete, SilverStripe 2.4's jQuery webapp library

Posted by Hamish Friedlander on 20 October 2009

Update (3 December 2009): Concrete has now been renamed Entwine.

We'd like to announce the release of the Entwine and Selector libraries for jQuery.

Developed by Hamish Friedlander, and partially sponsored by SilverStripe, this library will provide the architectural underpinnings for JavaScript in SilverStripe v2.4.

Although initially developed for use with client sites, the library has proven so useful that it's been spun off into an independent project. It lets developers write frontend web-application code in a clean and extendable manner—which is important in SilverStripe to ensure that, when the system needs extending for a particular site, the architecture doesn't get in the way.

For the techies in the room:

Entwine 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 Behavior and Low Pro libraries and jQuery’s Effen and Live Query libraries. However, we're extending the concepts of those libraries 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, Entwine 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 Entwine is Selector - a CSS selector engine developed in conjunction with Entwine to give it maximum performance. For the use patterns it is 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 and a tutorial, there is an 18-minute screencast available to help introduce the new concepts:

Post your comment

Note: Comments are moderated and won't show until they are approved

Comments

  • Hamish, thanks for your reply. I look forward to seeing how you'll put it to use in 3.0 - the JavaScript behind the CMS seems amazingly complex so having it all bundled up in a coherent structure will definitely be beneficial.

    I might be pushing my luck here, but is there any timeline on the release of beta/RCs of 3.0? I'm implementing a large-ish site in 2.4.4 these days (my first SS project) and I find some of the feature announcements/mailinglist debates regarding 3.0 rather intriguing.

    On a completely unreleated note, may I suggest adding an email field to the comment form to allow for notifications when comments are added to a post I've commented on?

    Posted by Asbjørn Clemmensen, 3 years ago @misterac

  • @Asbjørn:

    We moved the jQuery rewrite of the CMS (which is the primary place Entwine is used within SilverStripe) from release 2.4 to release 3.0 in order to get the 2.4 release out faster.

    We do use Entwine quite a lot in internal projects, so there is some dogfooding going on. The reason there haven't been many commits to the Entwine project recently is because it's been pretty stable & bugfree for us, and does what we want.

    Posted by Hamish Friedlander, 3 years ago @hafriedlander

  • Entwine looks like an amazingly powerful tool and I'm really looking forward to using it.

    I'm wondering, though, why it doesn't seem to be part of SS 2.4. I see it mentioned around the source, but only as "consider using jQuery.entwine" or "to be replaced by jQuery.entwine."

    My question is, is Entwine moving into 2.5/3.0? How come it's currently not in use? Essentially it's a question of dogfooding.

    Posted by Asbjørn Clemmensen, 3 years ago @misterac

  • Any thoughts on dual support for moo tools and j query?

    Posted by Dave @ Learn Spanish, 4 years ago

  • Well done Hamish! Hopefully the sponsorship contributed some cups of coffee for all long hours behind the screen :)

    Posted by PhoneSnoop, 4 years ago

  • Please note that since posting, this technology has been renamed to Entwine...

    Posted by Sigurd Magnusson, 5 years ago

  • Nice video. Can hover function of JQuery be used instead of onmouseenter and onmouseleave?
    Thanks.

    Posted by sugumar, 5 years ago

  • Perhaps it's more worthwhile to use Mootools given the 4 main points mentioned are pretty much the philosophy of it's framework! And better yet, 1.2.4 is optimised to lazy load the library base on the dependencies.

    Posted by Antonio, 5 years ago

  • When it makes it way into svn version of SilverStripe?

    Posted by Victor Ivrii, 5 years ago

  • Nice to see a post mention silverstripe 2.4. When can we get the earliest bits of the new SS 2.4?

    Posted by Lamin Barrow, 5 years ago

RSS feed for comments on this page | RSS feed for all comments

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.