Latest Posts

Archives [+]

Categories [+]

Authors [+]

Entries filed under 'microjax'

    Posted by Michael Marth JAN 18, 2008

    Posted in jcr, microjax, microsling, rest, ria, ujax and usling Comments 7

    Ever since Gmail entered the Internet we have seen an ever increasing interest in the "client". Before Gmail (in the beginning of this century) the best practice for web applications was HTML pages that were dynamically generated on the server-side. The high level system architecture of such an application would usually consist of a data base, an application server of some kind that generates the HTML and the browser.

    Fast forward to 2008: the world has changed. Let me highlight some differences to 5 years ago.

    • The user experience of web applications is more of a concern and has been improved a lot. Consider Flickr’s drag-and-drop interface or iGoogle. While they were not technically impossible few considered to implement such an UI back then. In general, this means that more code is executed on the client (aka AJAX).
    • Servers routinely pump out pure data (rather than markup) in formats like RSS or JSON. This data can be integrated and displayed on the client (see the whole mash-ups phenomenon). From the point of view of the application developer all he does is write the client.

    These developments have an impact on the high level system architecture: the client actually does something (rather than just render documents). And more: the client consumes data from the server (rather than documents to render).

    So where does the "business logic" reside now? There is a continuum of possibilities: on one extreme it resides exclusively on the server (this is the "old style"). Then there is AJAX applications, where usually some logic resides on the server and some on the client. And by now, there is also the other extreme: all logic resides on the client (Bob Buffone has a nice slide on this continuum, see his presentation, slide 9).

    The clients are alright

    Let us look at the extreme case "all logic on the client". It might seem an unnatural thing to do (especially if you spent the last years coding server-executed JSPs or PHP scripts). But consider the technologies used for building Rich Internet Applications like Flex or Silverlight. If you use such a technology it is quite obvious that the client exchanges nothing but raw data with the server. Who in his right mind would let the server dynamically generate parts of a Flex application? Now, if you think about it, with an AJAX client the situation is not so different.

    So in summary, it has become a perfectly valid possibility for an application design to place all logic onto the client.

    The architectural change

    If a certain amount of business logic resides on the server writing an application invariably means server programming. The server is your application.

    However, in an architecture where the server just persists data and serves it to a client where the application logic resides this is necessarily the case anymore. If there is no application logic on the server then the server is just a piece of standard infrastructure much like a RDBMS is today (most people do not code business logic into their data base. Oh well, yes, some do). It just sits there, but there is no coding to be done on it.

    Meet microjax

    This type of application architecture is what David Nuescheler is aiming at with microjax. Let the client do the UI (because the client-side technologies are so much better at that) and let the server serve the data.

    In microjax you have a (JCR) content repository and a very thin layer on top that reads and writes JSON. This means that the server-side is not split into the classical database/application server combo. Your data is your web server. The mapping between data and JSON output is implicit and does not need any explicit coding. The access rights are in your JCR (on "row level" in db lingo).

    Let me highlight some implications of this:

    • There is no need for server-side scripts.
    • There is no need for db drivers. A REST interface is the "driver".
    • There is less need for server-side CPUs. The clients bring their own.
    • Web application development requires only HTML and Javascript skills (no PHP, JSP, ASP, …) which is around in abundance and the artificial boundary between web designers and server developers that translate their work into server code is gone.

    See here to get started with microjax.

    In the blogosphere

    Who else is on this case? Peter Svensson has been exploring similar ideas (see his blog post The End of Web Frameworks and the follow-up Alternatives to Server-side Web Frameworks.

    Even more, for his project Mashupstation Peter has come up with these interesting rules for application development:

    1. All functionality that possibly can be implemented on the client side shall be implemented on the client side.
    2. All communication with the server middleware shall be constrained to service-interfaces; For instance REST.
    3. No part of the client shall be evoked, generated or templated from the server-side. This rules out in-line conditional HTML in JSP, ASP, PHP, etc.
    4. The logic making up the server middleware will be implementing only the following functionality:
    a. Security
    b. Database access
    c. Cross-domain proxying for remote resources implementing only a) and b).

    These rules could have been taken from the microjax textbook it seems to me.

    Back to the continuum

    As I described above, the "all logic on the client" case is an extreme case of a continuum. But this extreme case might not be the right choice for each and every application. Luckily, microjax is part of microsling. Microsling allows application developers to execute server-side scripts that are implemented e.g. in Javascript. As such, the application developer can freely decide how much logic shall reside on the server and how much shall be on the client. Since both environments are coded in the same programming language moving logic back and forth is rather seamless (to get started with microsling see here).

    IBM "gets it"

    From the high level architecture view microjax and CouchDB are very similar. Both combine persistence (without prior structure) and a web server. Now, IBM has recently bought CouchDB.

    IBM’s employee Patrick Mueller blogged about this purchase:

    It's a web server and a database. And to me, this is the most interesting point. Just as we've seen client programs start to embed web browsing technology (like iTunes), there's really no reason why server programs like a database shouldn't be able to embed a web server.

    Apparently, Big Blue considers the architectural change described above to be relevant.

    As a side-note: while microjax and CouchDB are similar in ideas, but they differ in maturity. JCR implementations like Apache Jackrabbit (upon which microjax is based) have been in production use for years. Plus, there are tools for using them efficiently.

    And another note: the "without prior structure" bracket above is further explored here.

    Posted by David Nuescheler DEC 12, 2007

    Posted in crx, microjax, microsling, sling and tutorial Comments 10

    µjax (microjax or ujax) is a client sided javascript persistence layer that leverages the symbiosis of a (JCR compliant) Content Repository and the agilepatterns of browser based ajax development, to form a completely new wayof developing applications.

    microjax is a part of Apache Sling which is currently in incubation.

    As an important differentiator to other Ajax frameworks µjax focuses onadding an attractive server-sided persistence and does not focuson providing a rich application framework with components, widgets or visual effects.µjax can be combined with any Ajax framework of your choosing.

    µjax uses XHR & JSON based AJAX techniques to retrieve contentand uses regular form input to write content.

     

    Download, Register & Install


    Prerequisites

    Knowledge of Javascript and HTML are required.

    An understanding of JCR is certainlyvery helpful to quickly start developing in µjax.

     

    Download

    The µjax pre-release can be downloaded attached (below) to this post pre-packed with the attached CRX builds.(Windows, Unix, Linux & macosx)

    Keep in mind:

    Nightly builds are intended to provide CRX Developers with the latestenhancements and bug fixes. A NIGHTLY BUILD IS NOT AN OFFICIAL RELEASEAND IT IS NOT TESTED BY QA. USE IT AT YOUR OWN RISK. IT IS RECOMMENDEDNOT TO USE A NIGHTLY BUILD ON A PRODUCTION SYSTEM, BUT TO USE IT FORDEVELOPMENT PURPOSES ONLY. DAY MANAGEMENT AG CANNOT BE HELD RESPONSIBLEFOR ANY DAMAGE THAT COULD BE CAUSED BY A NIGHTLY BUILD.

     

    Register

    To be able to install CRX you will have to get an evaluation license, which can beobtained by filling out the following form.

     

    Install

    µjax is only installed in the default installation of CRX, so pleaseselect that option in your downloaded CRX installer.

    The installation is very straight forward and does not have dependencies beyonda JDK 1.4 or greater.

     

    Mount your workspace

    To be able to interact with the content repository for development purposesit is recommended to use webdav and connect to
    http://localhost:7402/crx/repository/crx.default

    On Windows use "My Network Places" / "Add new network place"

    On macosx use "Go" / "Connect to Server" in Finder

     

    Look around

    Explore you content repository athttp://localhost:7402/crx, as soon as you start developing your applications you will find both your code and also the content your applicationscreate in the "Content Explorer".

    First Steps

    To get started please either use the test application below orjust extract the "firststeps.zip" (below) and drag and drop the "apps" folder into root folder of your webdav mount.

     

    Test application:

    Put the source code below into a test.html file and drag this into your mounted webdav drive:

    <html><head><title>Hello World</title><script src="/ujax/ujax.js"></script></head><body><script>var welcomeNode=ujax.getContent("/content/welcome");</script><h1>Welcome String:<script>if(welcomeNode)
    { document.write(welcomeNode.hello); }
    </script></h1><form action="/content/welcome" method="POST"><input name="hello" value="" /><input type="submit"></form><script>ujax.wizard();</script></body></html>

    and hit http://localhost:7402/test.html

    in your browser.

     

    µjax Version of "Stefano's Linotype"

    To get a feeling of a more real-life application feel free to downloadan µjax-ed version of Stefano's Linotypeyou can simply extract the "linotype.zip" (attached below)into the /apps folder of your webdav drive pointing at http://localhost:7402/

    After the installation hit http://localhost:7402/content/linotype/posts/*.post.htmland hit the save button to create your first blogentry. After creating the post you can surf to http://localhost:7402/content/linotype.html

    Please keep in mind that this is really just prototype to explain the µjaxbasic concepts and how they could be applied to existing web applicationswithout a lot of effort.

    * crx-ujax_windows_installer.exe
    crx-ujax_windows_installer.exe
    * crx-ujax_unix_macosx_installer.sh
    crx-ujax_unix_macosx_installer.sh
    * linotype.zip
    linotype.zip
    * firststeps.zip
    firststeps.zip

    Posted by David Nuescheler DEC 09, 2007

    Posted in announcements, crx, microjax and microsling Add comment

    I am happy to be back at Javapolis this year, I will show "microjax" for the first time. microjax is developed as a part of microsling in the Apache Sling Project which is currently in the incubator. Javapolis is probably the largest european Java Developer conference and also great fun that I can whole-heartedly recommend.


    View Larger Map

    I think microjax is huge for two reasons:

    1. It grants direct a mash-up experience to client side developers that work with JCR based content repository infrastructure. This takes all the J2EE-heavyweight pain out of the application development experience.
    2. It is mind-boggling to think that all your code is executed on the client. I have been working for with microjax for the last couple of days to prepare, I am happy to report that its agility is mind blowing. I think this really changes the game in the sense that it completely removes changes the role of a traditional application server.

    Anyway, if you happen to be in Belgium please join me for the session on Kick starting the Content Repository. AJAX meets JCR.

    I am convinced that if you have any interest in Content Repositories this introduction to microjax is time very well spent.