Re: Suggested BP for BP 2 : Use script for the dynamic aspects of the user interface

So I'm open for being corrected on this one, but I think I disagree on this
point -- in fact I was getting around to suggesting a BP that said
completely the opposite. :)

BP: Use markup language to create the minimal page framework and flesh out
repetitive/dynamic aspects of the page using javascript.

The logic of this is:
- lets say I have a page displaying 100 contacts... the data for those
contacts is much more compactly transmitted as a json string than as
fully-rendered HTML.
- the framework page ideally contains no dynamic data so it can be much more
aggressively cached.
- a "loading" spinner can be displayed while an asynchronous request is made
to get the guts of the data... since a small and/or aggressively cached html
page would load quickly this creates a better user-experience overall.

This is the approach we are using in our applications at the moment and it
seems to be giving us a better overall user-experience. It would be useful
to understand the tradeoffs though -- perhaps an experiment is required ?

I don't know much about impacts to battery life but since it's a short-term
bit of processing at the moment the page is displayed I can't imagine it has
such a dramatic effect.

Thoughts ?

On Wed, Feb 27, 2008 at 7:43 AM, José Manuel Cantera Fonseca <jmcf@tid.es>
wrote:

>
> BP
>
> Use script only for the dynamic aspects of the user interface. DOM
> manipulation and creation of new nodes can consume a lot of battery at
> the device side, so as much as possible create user interface elements
> using the markup language and modify (if needed) those elements using
> scripting
>
> How to do it
>
> When a page is first served from the server side, it should contain all
> the markup that declares and populates user interface elements (forms,
> selects, input, etc). If rich interactions are needed later then use
> scripting to mutate or modify the DOM of the page
>
>

Received on Thursday, 28 February 2008 13:04:14 UTC