I can make no claims to being any kind of exceptional programmer. Heck,
I don't even claim to be half bad. But this topic has really revealed to
me that the concept of MVC means many things to many people.

In the end, I think what I have concluded, at least for my purposes, is
simply this:

1. Modules that deal with core data (i.e. that read/write to the
database) shall never output HTML/XML/Whatever. Just hashed (complex)
data, or simple arrays.

2. Modules that DO create HTML/XML/Whatever should take the core level
data and make the html

3. Modules that present the data should take the html produced by #2
above, wrap as needed in start and end tags, and spit out the resulting
page. They data output by #2 shouldn't matter to this module.

Whereas I know this is overly simplistic, I think that as a rule, it
should work. If I catch myself sticking HTML into the output from my DBI
call before I return the final result, I know I have broken my rule and
should re-think whatever I am doing. I should never really have to edit
#3 (the Viewer), because the HTML construction should be done in #2. If
I find myself editing my viewer to accomodate some function I am adding
to the overall system, I know I need to re-think what I am doing.

Simplistic, yes. Workable, yes. It meets the KISS principle, at least.
;-)

Comments, disagreements, smacks across the virtual face willingly
accepted.

--Jon Robison

Reply via email to