PHPBuilder - Object Orientation Page 2



RSS Twitter
Articles Application Architecture

Object Orientation - Page 2

by: Mark Williams
|
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!
Constants
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:

<?php

// Database Constants

$HOST             =     "localhost";
$DB            =    "testing";
$WEBUSER        =    "root";
$WEBPASSWORD        =    "";

// Colour Constants

$COLOR_PRIMARY        =    "#037B0B";
$COLOR_SECONDARY    =    "#FFFFC0";
$COLOR_TERTIARY        =    "#ECED81";

// Value Constants

$TRUE            =    1;
$FALSE            =    0;
    
// Application Specific
$TITLE            =    "Object Orientation Demonstration";
$ADMINEMAIL        =    "webmaster@domin.com";
    
// 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.

« Previous Page
1
|
2
|
3
|
4
|
5
|
6
|
7
|
8
Next Page »

Comment and Contribute

Your comment has been submitted and is pending approval.

Author:
Mark Williams

Comment:



Comment:

(Maximum characters: 1200). You have characters left.