Joe Walker On Ajax Architecture

Joe Walker of DWR fame has written an interesting piece on Ajax Architecture here, questioning how the existing round of web frameworks measure up to Ajax. He describes the extreme case in which most processing logic is moved into the Javascript code, and the server is relegated to providing data feeds.

It’s a topic that I’ve given a lot of thought to in my own Ajax coding, and in writing the book for Manning (see Chapter 5 for my full take on these topics when it comes out).

It’s nice to move as much of the Domain Model/Business Logic as possible up into the web browser - for better responsiveness - but, at the same time, there are all sorts of things that can only be done on the server, such as database connectivity, accessing legacy services or third-party libraries that don’t happen to be written in javascript, etc. And no, opening up your database to any old query submitted in the URL querystring is definitely NOT the answer to this!

So, we’re kind of stuck with a split domain model, partly implemented on the client, and partly on the server. A recipe for complexity, if not downright trouble. The best solution that I’ve come up with so far is to think of the srver-side domain model as the master, and the client-side model as a slave, providing only as much model as required to improve responsiveness, and delegating to the server where it makes sense.

I’m the first to agree that that’s a very hand-wavey kind of solution, and there’s still a lot of thinking and doing still to go on this topic. Any fellow hand-wavers welcome to pitch in their $0.02.

Comments are closed.