#native_company# #native_desc#

Object Orientation Page 2

By Mark Williams
on July 30, 2000

Development Process

As always, we will start by defining our global constants, then we’ll move onto create our
data schema (and database), followed by our data class, then our box classes and finally, we’ll create
the .phtml file, which will bring it all together into a working example – or at least, that’s the plan
at the moment!
This is a straight forward PHP file, which I create to define Constant values I can use
across a whole site. By using this – appropriately – I can change the look/feel of a site from one
place, rather than having to chase variable values across multiple pages. Here’s our constants.inc sample:


// Database Constants

$HOST             =     "localhost";

$DB            =    "testing";

$WEBUSER        =    "root";

$WEBPASSWORD        =    "";

// Colour Constants

$COLOR_PRIMARY        =    "#037B0B";


$COLOR_TERTIARY        =    "#ECED81";

// Value Constants

$TRUE            =    1;

$FALSE            =    0;


// Application Specific

$TITLE            =    "Object Orientation Demonstration";

$ADMINEMAIL        =    "[email protected]";


// CSS Plug-in Values


$CSSBOXTITLE        =     "boxtitle";



Database Schema

Under no circumstances should this be taken as a de-facto database schema, but it works for
the purposes of this example:
[Image:] Entities & Relationships
As you can see, the data for News is in a table in its own right, whilst the race, driver,
team and points details are the result of related tables. Suffice to say, if you do not understand
this schema, you should go and read up on some RDBMS introductory material before going any further.