Conventional Web Development

Top  Previous  Next

As far as the developing a web page that provides dynamic content is concerned, today, no matter which enabling technology is used the development scenario is almost the same:

1.The designer finishes his work on the page (designing the layout: choosing the fonts and colors, placing the images and providing dynamic effects).
If, for example, the page is supposed to display a list of the products that are available in a database, the designer prepares a two-row table as follows that consist of a header row and a row that will be repeated for the each product in the list.

Design_ASP

2.After taking over the HTML code of the candidate dynamic page from the designer, the programmer inserts code snippets into the HTML document depending on the enabling technology used.
Below you can see the inserted code in ASP VB language to query the database and repeat the second row of the table along with the records existing in the record set.

 

  ...

  ... 

  <table border="1" width="100%">  

    <tr>

      <td width="58%" bgcolor="#C0C0C0"><b>Name</b></td>

      <td width="17%" bgcolor="#C0C0C0" align="center"><b>Stock</b></td>

      <td width="25%" bgcolor="#C0C0C0" align="right"><b>Price</b></td>

    </tr>

    <%

    Set con = Server.CreateObject("ADODB.Connection")

    con.Open "Connection definitions...."

              

    Set rs = Server.CreateObject("ADODB.Recordset")

    rs.Open "select * from products", con

              

    Do While Not rs.EOF 

    %>

    <tr>

      <td width="58%"><% rs.Fields("Name").Value  %></td>

      <td width="17%"><% rs.Fields("Stock").Value %></td>

      <td width="25%"><% rs.Fields("Price").Value %></td>

    </tr>

    <%

      rs.MoveNext

    Loop

              

    rs.Close            ' Close RecordSet

    Set rs = Nothing    ' Free RecordSet Object

    con.Close           ' Close DB Connection

    Set con = Nothing   ' Free DB Connection Object

    %>  

              

  </table>

  ...

  ...

 

Don't you also think something is wrong here? We've been always told that a good planned system should have distinct tiers for the presentation, the business logic and the persistency. Here I see an HTML page, or should I call it a program, that makes a connection to database, applies a certain application logic and formats the output for the user.

This page is just a simple example that repeats a table row with the data acquired with a database query. What if this would be a page used in typical e-commerce application where tens of different types of data acquired and formatted. The answer is, without a doubt, a mess.

Besides, although HTML is a standard language, after inserting such vendor specific codes in it, it looses this feature. You cannot use this page, for example, on a PHP or Java Application server.