Monday, January 31, 2011

Re: Formatting data - best on the server, or client?

My Right Thing is as follows.

I will generally do some transformation work on the server side. Not
to HTML, mind you, since that, to me, is purely presentation layer
work. Rather, I will take the raw data and package it into lean
records objects, and send the collection of those to the client. This
work may mostly be done in SQL, or might mostly be done in code,
depending on how your DAO layer is set up, and how much crunching is

The collection of record objects is then shipped off to the client,
where the display is taken care of. All of the values should already
be pre-calculated in the record objects, so it just has to go about
making them all pretty.

So in this wall all work related to the contents of the report (the
data itself, and its logical organization) are handled server side.
But the server stays out of the pretty display business - thats purely
client. The server generates no HTML, which is good, as I have found
that to be extremely painful on most occasions.


On Jan 30, 6:42 pm, tachoknight <> wrote:
> Hi all-
> I am writing a site that generates an HTML-based report that uses some
> pretty complex table formatting (think of it as a web page equivalent
> of the phone book). This is not a big site, and the result page is not
> interactive; it's a static report.
> I've mocked up the result page in an HTML page with CSS and the
> formatting is fine for all browsers, but now I'm at something of an
> impasse in how to implement it. In a JSP world I'd just be populating
> the jsp file on the server and displaying the results in the browser.
> As it is, I'm using GWT (obviously... :) ) and I'm at a loss as to how
> to "properly" do this.
> I looked into the UIBinder class, which would give me the HTML
> template, but that means that the result set would have to be
> transmitted to the client and all the work done in the browser. I
> could use something like FreeMarker to format the results on the
> server, and then send back the generated HTML, which is the method I'm
> leaning towards, but that too seems sub-optimal.
> Any assistance on the "right thing" would be appreciated.

You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at

No comments:

Post a Comment