First Official Release of Sling
The Apache Sling team recently announced the first official release of Sling. Now you can download some nicely packaged Sling bundles to play around with.
I have been experimenting with the Sling/CRX bundle that came with Day Software's JCR Cup 2008 competition (entries due midnight September, 30) and was really impressed by what I saw.
Sling allows you to write applications on top of the JCR using either server side or client side Javascript. On the server side, you can create Java Script Templates (ESP files) that give you access to the full JCR API. Templates are stored in the repository and called using an elegant MVC request processing framework. Templates can be called directly, or can be associated with content types and executed when an asset of that time is requested. As you might expect from Roy Fielding's employer, it is all very REST. For client-side scripting, you just import a Javascript file called sling.js and you get methods like "Sling.getContent" (which gives you an array of Javascript objects).
Despite the fact that Sling is still an incubation project, it is fairly mature and robust. Day's upcoming release of Communiqué (version 5) uses Sling extensively. I envision Sling being used in a presentation tier where pages are statically rendered (baked) from content in the JCR and Sling is used to power dynamic AJAX overlays using content from replicated JCR workspaces.
I really like the fact that logic is written in an interpreted language like Javascript. Development and deployment is faster when you take out the compilation step. Furthermore, Sling is built as OSGi (using Apache Felix) bundles so it is more modular and flexible than a typical monolithic Java web application.
The CRX (or the free Apache JackRabbit implementation of the JCR) and Sling should be considered along side Alfresco with its elegant Web Scripts (which also uses Javascript as a scripting language). Alfresco has some nice virtualization features but there may be a higher level of lock-in to the Alfresco API's. Alfresco has a user-oriented user interface while the CRX only has a JCR browser which is really only intended for administrators. However, in both cases, you will probably want to develop your own user interfaces because Alfresco's current WCM UI is not optimized for managing web content (improvements are scheduled for mid 2009 - interestingly, the Alfresco team is calling these enhancements "project Slingshot).
I have been experimenting with the Sling/CRX bundle that came with Day Software's JCR Cup 2008 competition (entries due midnight September, 30) and was really impressed by what I saw.
Sling allows you to write applications on top of the JCR using either server side or client side Javascript. On the server side, you can create Java Script Templates (ESP files) that give you access to the full JCR API. Templates are stored in the repository and called using an elegant MVC request processing framework. Templates can be called directly, or can be associated with content types and executed when an asset of that time is requested. As you might expect from Roy Fielding's employer, it is all very REST. For client-side scripting, you just import a Javascript file called sling.js and you get methods like "Sling.getContent" (which gives you an array of Javascript objects).
Despite the fact that Sling is still an incubation project, it is fairly mature and robust. Day's upcoming release of Communiqué (version 5) uses Sling extensively. I envision Sling being used in a presentation tier where pages are statically rendered (baked) from content in the JCR and Sling is used to power dynamic AJAX overlays using content from replicated JCR workspaces.
I really like the fact that logic is written in an interpreted language like Javascript. Development and deployment is faster when you take out the compilation step. Furthermore, Sling is built as OSGi (using Apache Felix) bundles so it is more modular and flexible than a typical monolithic Java web application.
The CRX (or the free Apache JackRabbit implementation of the JCR) and Sling should be considered along side Alfresco with its elegant Web Scripts (which also uses Javascript as a scripting language). Alfresco has some nice virtualization features but there may be a higher level of lock-in to the Alfresco API's. Alfresco has a user-oriented user interface while the CRX only has a JCR browser which is really only intended for administrators. However, in both cases, you will probably want to develop your own user interfaces because Alfresco's current WCM UI is not optimized for managing web content (improvements are scheduled for mid 2009 - interestingly, the Alfresco team is calling these enhancements "project Slingshot).
Labels: alfresco, architecture, java, jcr





6 Comments:
Just to add a missing point. Sling is not limited to esp(serverside js) or jst(clientside js) but has a wide support of rendering technologies. Not every renderer may be as mature and stable as the mentioned, but as everything in the sling context they are in constant 'evolution' and may fit your needs more then any JS technology.
Alfresco's Project Slingshot is coming out very soon. First release is due within a month. This is no shot at Sling, which is designed for JCR. Slingshot is a reference to David and Goliath. It will also include an open Atom Publishing Protocol based API for interoperability with other languages and platforms. The APP API will come out about a month after the initial release.
Thanks for the clarifications! TheLigntning: Is there any documentation on how to hook up other rendering engines?
John: I am looking forward to seeing Slingshot. When will Slingshot be rolled into EE?
Seth: there's no documentation yet on how to create more scripting engines, but that shouldn't be hard if you take one of the simple existing ones as an example.
The JRuby engine [1] for example, is built out of two simple classes, one that inherits from AbstractSlingScriptEngine, and one that inherits from AbstractScriptEngineFactory. And one META-INF/services/javax.script.ScriptEngineFactory file to let the scripting system know about the factory class.
[1] http://svn.apache.org/viewvc/incubator/sling/trunk/scripting/ruby/
I just added information about how to create new script engines to the Sling FAQ.
Thanks Bertrand!
Post a Comment
Links to this post:
Create a Link
<< Home