Friday, May 30, 2008

Web application design philosophy - HELP!?

Full disclosure: I started developing web apps like two days ago. This post is written as a n00b, not as a source of authority.

Not to be intimidated, I got out my slate and chalk, and began doing screenshot designs for a rich internet application (RIA) I want to write. I found myself some whizzbang technology, in this case Google Apps Engine and the Extjs javascript widget framework. They're both pretty easy to work with (so long as you don't need to do any debugging) and I managed to prototype myself some pages to do Neat Stuff.

I'm now faced with a difficult path to actually learning how to write a web application "properly". With a standalone GUI app, I'm pretty much fine with application design, breaking things up into an MVC model and then doing an object-oriented design of each bit. With a web application, it's not so clear how I should do things.

If I were designing something in static HTML, all the logic goes on the web server. The user clicks "load data" and the web server goes and produces a static HTML page showing the data loaded. The application brain is in the server, and the purpose of the HTML page is to render the user interface to the client.

It appears possible to basically do the complete opposite with javascript, and put basically all the processing logic into the javascript, treating the web server as just something to go fetch resources from.

So should the logic go?

I'm worried that if I pursue a heterogenous design, whereby the application logic is split between client and server, that I will then have an unsatisfactory level of coupling between the two. Should the database be the 'model', the web server be the 'controller' and the client be the 'view'?

Presumably, if I put heaps of logic into the javascript, then network overhead will be high but latency will be good? Whereas perhaps if I do it the other way, network overhead will be low but many more requests will be necessary, thus slowing application responsiveness?

Where do XML web services and SOAP requests come in? "Should" I be using these as an API, or should I just request data and perform my processing in javascript?

How do I write a web application such that it is reasonably 'pluggable' -- that is such that I could alter my choice of server, database or javascript extension library without killing myself?

Should I use something like Django's templating to control the GUI or should I put all the GUI design into my javascript? Should there be a javascript object representing the whole application which then loads the navbar, display and other widgets?

Should I do form processing on the web server, or in the javascript?


I think, maybe, the index page should be a trad "web page" kind of page, with links to the RIA pages.


Wednesday, May 28, 2008

OSDC 2008

From 1 to 5 Dec, in Sydney, Australia, the Open Source Developer's Conference 2008 will be held ( I will, in all probability, be attending this. I would love to get in touch with any other Pythoneers who may be going. It would be fantastic to organise some group sessions and do some networking. Also, if there's anyone else who works for the Aus govt it would be good to hear about what kind of open source applications are getting a guernsey in your depts.

I thought it would be neat if we could find some leading Aussie python people and rope them into giving a panel talk on some topic, leading a discussion or some such.

Tuesday, May 20, 2008

Advanced Document Notes

I just started a Google App Engine trial and my goal is to prototype an application I've always wanted. If it works, I will even use it. It's really simple to explain -- I want to take notes against documents. Then, I want fulltext search through everything.

There are files. Some are public some are private. Let's assume they are all PDF articles that I want to write about.

There is a common document store and a private document store. Documents can be shared, and you can read eachother's notes! Yay! But some are private, because sharing them would be bad for some reason. So you have access to the global store (which is like a wiki) and the private store.

Okay, so you log in, and can upload a file. Yay! Then you take notes against it, which is stored in a notes file and related to the original file.

Then, you can have a display where the PDF is viewed on the left and the notes are viewed on the right.

So, you could share something like a PDF, text file, web page or even binary media file, and share comments on it. I envisage it as being great for the following uses:

1) An academic who wants to create a personal store of research notes
2) An academic who wants to collaborate on creating research notes, such as with fellow researchers or students
3) Anyone who wants to share comments about files.
4) A workplace where a group wants to share around a file for comment

I just hope I can find time to actually do this. I don't think it will be particularly hard, but neither do I have a lot of free time.

Anyway, cool! GAE!

I'm trying not to think of any additional functionality at this stage, but ideas keep popping into my head anyway.