Chapter 9 Review:

• What is MVC? How is MVC implemented in this chapter? What are the benefits to using MVC? (See pages 284 and 285.)

MVC is Model View Controller - and it describes the separation of code into the Model (referring to data model), the view (what the user "sees"), and the controller (the logic code that handles the data and sets it up form presentation in the view).

In our CMS, the Model is the Mysql tables, the View the html files in the views folder, and the Controller - the php pages that drive the main functionality.

MVC provides separate of the largest scope functionality so it can be developed, tested, and evolved separately.

• What does an autoloading function do? Why must it be defined before the session is started? (See pages 279 and 294.)

Autoloading is a nifty feature that only calls upon classes as needed. It must be called pre-session so that the user data can be stored.

 

• What does it mean to serialize and unserialize data? (See page 294.)

Serializing takes object data into a var_dump like state for storing in a field/record. Then unserialize can return it to its object state.

• Why must some of the catch blocks catch generic Exception objects, not PDOException objects? (See page 251.)

PDOexeception is an extension to Exception, so it wouldn't apply to other OOP error types.

 

 

Toggle Sidebar