Brett W. McCoy wrote:
: On Sat, 16 Jun 2001, Steve Howard wrote:
: 
: > Can someone point me to an example of a completely Object Oriented CGI
: > script. The Perldoc examples are procedural, but there must be a good OOP
: > example somewhere for me to tear apart and learn that technique from.
: ...
: Basically, we had one class that
: modelled the data (using DBI underneath, but it was hidden by the class's
: interface), another class that handled displaying the data (using CGI, but
: again, the interface hid the details of CGI), and finally, a third top
: level class that decided which screen to display by dynamically
: dispatching methods based on a state variable to determine which screen
: needed to be displayed.

An interesting twist on the display is to use templates, e.g. the
Template Toolkit or HTML::Template. Then not only is the display
separated from the logic, but the views can then be maintained by a
non-programmer.

-- tdk

Reply via email to