DEVELOPMENT

MDA, SOA and Serverless AJAX: Our web stack defined

Ok, time to geek out and talk about the technology behind APPLEBOX. Whilst we think our model for the local DVD store is a winner (we’ve reduced store overheads, embraced the Internet and kept a strong sense of local community even from the web) we also completely love the technology! Forget Rails, we’ve got a J2EE web stack that we think is second to none. Check it out:

  • Our architecture is SOA (Service Oriented)
    All our application calls are SOAP, which from the ground up creates an API we will give public exposure to at a later date. For example this call returns a movie profile.
  • Our storefront is Serverless AJAX
    The Web 2.0 movement has swept AJAX into the mainstream. We take that one step further and deliver our complete application as Serverless AJAX that makes stateless SOAP calls to our backend.
  • Our development process is Model Driven (MDA)
    Rails gives the Ruby community productivity. For us, MDA gives J2EE a similar shot in the arm. Our complete stack with stubs for all business methods and web services, a default CRUD service layer, and all the J2EE XML config files are generated from a UML model. We can iterate from UML through to database and service layers in a matter of minutes. The MDA generator we use is AndroMDA.
  • Our J2EE components are
    Axis (Web Services), Acegi (Security), Spring (Transactions), Hibernate (ORM), MySQL (Database) and JBoss (App Server).

The key to everything we do is the Serverless AJAX. As I mentioned in a previous post, we take the Single Page Application model, and chain multiples of them together as iframes within the browser. These SPAs are housed within a JavaScript controller that moves between each SPA as the application requires it. This is standard MVC, but the C and the V are in the browser, rather than on the server. So we’ve got:

  • Static delivery of htm/js SPAs to the browser (no dynamic markup). All SPAs can be downloaded at startup or on request
  • A stateful htm/js client where UI components persist until the app is closed
  • Full containment of the view & controller in the browser
  • A JavaScript controller that binds multiple SPAs together all with interfaces that can be called directly from other SPAs or from the main controller. With a pub/sub mechanism each SPA can publish and subscribe to global application events as well.

This is good because:

  • The static htm and js resources can truly act as an application client, cached in the browser for next use. Cache headers are set to never expire, with versioning controlled within the URIs themselves (configured from a non-cacheable boot script).
  • Each UI keeps its own state. For eg, when the user manipulates a page (eg magnifies the poster art, or respositions a cover strip), when they come back to that page it’s the same as when they left it.
  • UI widgets don’t need to be rebuilt when navigating back.
  • The complete JavaScript framework and model remain in memory. No reparsing thousands of lines of JavaScript to reload the object model that was there an instant ago.

Additionally:

  • This scales well as repeat app use hits the server only for data. No pushing out reams of html, and app navigation is much less server bound.
  • We build our backend as an application API from day one. We can re-use the same application services for other clients. Eg, our catalogue services are used in the public storefront, in our in-house administration systems, and from our testing framework. As SOAP services, we can also call these from Flash, Silverlight, or a native Win or Mac client if we wished. We can also choose to freeze a subset of the API and offer them publicly.

This stack works for us and delivers great productivity. To see it all in action, just click through to applebox.com.au and hit ‘Browse DVDs’!

7 Comments:

  1. Dominik Hahn Says:

    This must be a bad joke. Call it APPLEbox and don’t support Safari.

  2. ctran Says:

    Yes, very sick joke! :-)
    Very nice UI!

  3. Eric Says:

    So, by “no dynamic markup” you mean that, once V and C are downloaded to client, there will be no more markup delivered from the server - BUT surely there will be dynamic changes to the markup on the client side - no?

  4. Simon Says:

    Hi Dominik!
    Yep, nobody around here understands my humour. But seriously, the restriction on Safari is purely technical. When I developed APPLEBOX, Safari (apart from having a serious lack of debugging facility) didn’t support XPATH which I use to query the SOAP XML documents returned from my application services. That was version 2. With Safari version 3 now released, the situation is greatly improved. There’s XPATH, Drosera and DOM Inspection. So once I get the time, I’ll be reviewing Safari and bring support to it!

    Eric,
    yep, you’re right. Once the V & C are downloaded, it’s DOM fairyland and there’s a huge amount of DHTML that goes on in the client!

  5. sarah Says:

    Feel wrong jumping in here as it is all strange words to me but the name APPLEBOX refers to a device used in filming and does not have anything to do with apple mac. It’s a snappy memorable name that has a tie in with movies and film making. No sick jokes there! http://applebox.com.au/about/

  6. Apple iTunes Store Recreated w/ HTML & AJAX? | David Bisset: Web Designer, Coder, Wordpress Guru Says:

    […] is a recreation (to an extent) of the iTunes store. According to their blog, they are using Ruby On Rails and “Serverless AJAX”. I wondered what the latter was, […]

  7. TechNation Australia » Blog Archive » Applebox - Your Video Store Reinvented Says:

    […] It’s your classic Clicks and Mortar strategy but executed to perfection. The best bit? The whole site has been custom built by Simon so they are more agile and responsive than their competitors. (You can check out more of the technical details, including their pretty cool web stack, HERE) […]