[thelist] separation of logic and presentation

Hassan Schroeder hassan at webtuitive.com
Mon Sep 22 15:15:02 CDT 2003


Diane Soini wrote, as part of a message with some other point :-)

>     You can do it however you want, divs or tables. My limitation was 
> that the programmers didn't know html well, didn't know what a div was, 
> and didn't have time or desire to learn about it.

>                     All the programmers have to do is make sure that 
> they use <th> for header cells, <td> for data cells.

>          And when it comes time to change things, you'll have a lot 
> less work to do, and a lot less people to consult and instruct.

But. This is an excellent time to suggest that the programmers in
question be forbidden to output *any* markup. Not THs, not TDs, not
anything. They should only handle the business logic and backend to
generate *data values*, and that's all.

Instead of something awful like this (JSP example):

   <% out.println("<Tr><TH>foo</TH><Td>bar</TD></TR>"); %>

:: good logic/data/presentation separation would be something like:

   <tr><th><%= thisFoo %></th><td><%= thisBar %></td></tr>

If you're using a templating solution like JSP, take advantage of
it! *No markup in program-generated output*. Period. Let the page
designer handle markup. Use your framework properly.

If you can get your programming team's buy-in to this, you'll have
made your job *and theirs* far easier. Development will go faster.
The sun will shine brighter. Beer will taste better. Really. :-)

FWIW!
-- 
Hassan Schroeder ----------------------------- hassan at webtuitive.com
Webtuitive Design ===  (+1) 408-938-0567   === http://webtuitive.com

                           dream.  code.





More information about the thelist mailing list