Model: Holds and deals with all data for the program, such as database connections / queries, session data, data consistency. I am currently using classes which use PEAR DB_DataObject for DB connections, querying, and data storage.
View: Deals with displaying of data from model. ONLY does displaying, no processing. Very minimal logic only associated with outputting. Currently, I am using Smarty entirely for the view. Little no no PHP code, only Smarty. The View in this case is just a smarty template file.
Controller: Handles requests from the browser. Instantiates Model and View, calls functions in Model to alter its state (updating from $_REQUEST vars, for instance). Chooses a view and then tells the view to display. For me, this is all home-grown PHP.
This architecture can be much more complicated in, say, a C++ program, but the Server/Client pattern built into web programs makes it much more simple. The reason that I use this particular architecture is that it factors all of the pieces of your program very nicely. Later, if you do things right, you can use a single screen from one program in another with minimal editing.
Here's a few pages that discuss MVC: http://ootips.org/mvc-pattern.html http://st-www.cs.uiuc.edu/users/smarch/st-docs/mvc.html
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php