no connection Zoomstats - Traffic Analyzing to its best.
 
 
ZoomStats
QuickStart
Downloads
Documentation
Flash Tour
 
 
 
CVS | Demo | Forums| Mailing Lists| The Crew | FAQ

ZoomStats OOD Logic

ZoomStats Class. (/index.php)

This class is the only class publicly called. It's main responsibility is compiling the configuration variables and call a sequence of inherited classes.

Shared Class. (/lib/shared.php)

This class contains all the default methods for application. It is somewhat similar to a default functions file, for the exception that, this class is inheriting by others, and if a method name repeats the last one will be used.

Section Classes (/lib/****.class.php)

These classes are the ZoomStats sections (think of them as ZoomStats pages). Name is passed in to the ZoomStats main class, controlled there and then defines the file name of section.

This class extends Shared class. It must have a constructor and all functions necessary. Works with every database types, unless a specific method is being defined by the ****_extension class. In that case, the last method will override the previous one. This is very useful for compatibility purposes.

Section Extension Classes (/lib/db/***/***.ext.php)

This is the directly called class by ZoomStats constructor. This class only serves to override the previously declared methods to gain the correct compatibility under specific database types.

EXAMPLE

Now, to explain it with code I will go backwards from the moment classes are called:


// assuming that the section we use is called 'test' and we use 'mysql'.



// file: /lib/shared.php

Class shared {

// Default variables for application scope
var $....;

// Default functions for application scope

function hello() {
echo '
helllo from SHARED'; } } // file: /lib/db/mysql/api.php Class api extends shared { // MySQL specific Operations. // ... // Mostly independent from other classes, however, might utilize API's functionality of 'Shared.php' } // file: /lib/test.class.php // The whole procedure for 'test' section. Class test extends api { function hello() { echo '
helllo from TEST'; } // Constructor function test() { ->hello(); } } // file: /lib/db/mysql/test.ext.php Class test_extension extends test { /* This Class is the first to be called, but can remain empty if of no use. The reason for having (and starting from) an extension id to be able override class methods due the fact this class is the parent and thus wages more. e.g: if, only for a specific database type, you would like to modify thedefault object you can add it here: function hello() { echo '
helllo from TEST'; } in this case, calling method hello() will use the method in this (parent) class instead of the child's. This is deadly useful to support the compatibility. */ }

Hope this help for the beginning to understand. We will eventually write a netter docs :-)




 


Open Source Definition SourceForge Logo

< Home - - Mail List Archive >

Copyright © 2002, 2003 ZoomStats Group