Zend Framework Testing - Day 2 - Time to Read
by mr. H8ers3rd
Sep
2008
All I did most of the day was read. Basically I wrote a php program about 1 year ago that used the NuSoap library, a MySQL database, a form, and AJAX. The program, when first written, worked straight out of the box after you uploaded the sql file to your database and changed the appropriate settings to connect to the database. What it did was make a SOAP request to the national weather service. So a user could input their zip code or city,state and would then receive a 3 day forecast for that area, it also cached the results so as not to send the same request twice in a 24 hour period of course ending at midnight.Ā It was written procedurally and not in an object oriented fashion. I would like to make this application conform to object oriented design, so I read.
So instead of programming today I read these:
- http://en.wikipedia.org/wiki/Model-View-Controller
a general description of the Implementations of MVC as web-based frameworks. - http://nemetral.net/2008/07/31/a-gentle-introduction-to-mvc-part-1/
A really good simplified explination of MVC. I read all three parts, answered a lot of questions. - http://framework.zend.com/manual/en/coding-standard.html
Long read but worth it
From what I gathered from reading these is the Model-View-Controller practice, is not about telling everyone how your apps are MVC compliant, but more about separating your web-based applications for easier maintenance. I am going to associate the names with a business atmosphere.
Model: This is the Accountant and handles data. In a request that takes data from a database and outputs the results the chain of command is, from what I can tell, as follows Controller -> View -> Controller -> Model -> Database -> Model -> Controller -> View. The controller brings up the view that has a form on it, the input is then sent back to the controller and then if data is needed it is then sent to the model, where manipulation of the data (sterilization, validation) is performed and then request is sent to the database on success the data is then sent back to the model for further manipulation and then the data is sent back to to the controller and then rendered by the view. But I could be wrong.
View: This is the Graphic Designer of the Marketing Department. Couldn’t care less about data or how it got their. The choice is yours. Do you want a sexy view or a repulsive view?
Controller: This is the Owner and coordinates everything that is going on in the business. What view am I using and what model am I using? The controller decides.
Basically that is what I retained from reading the two links about MVC, but as Levar Burton would say “Of course, you don’t have to take my word for it.”.
I put the third link for just general reading. Tomorrow I am going to be working on the form, the views and if time permits connecting to the database.
Tags: Zend Framework


September 7th, 2008 at 4:44 am
Thanks for the good words and good luck for your project!