Location: PHPKode > scripts > phpchartPlus > phpchartplus/Sources/DataStrategy_Interface.php
<?php

/*
**************************************************
Class: DataStrategy_Interface.php
**************************************************
Author: Tsiavos Chris <hide@address.com>
Date: October 2004
**************************************************/

class DataStrategy_Exception extends Exception {

	function DataStrategy_Exception($data) {
		Exception::__construct($data);
	}
	
}

/**
*Composes the Group class
*@author Tsiavos Chris <hide@address.com>
*@license http://opensource.org/licenses/gpl-license.php GNU Public License
*/
class GroupItem {
	
	/**
	*@access public
	*@var string
	*/
	public $ItemName;
	
	/**
	*@access public
	*@var integer
	*/
	public $ItemValue;
}

/**
*Represents a group of items
*@author Tsiavos Chris <hide@address.com>
*@license http://opensource.org/licenses/gpl-license.php GNU Public License
*/
class Group {

	/**
	*@access public
	*@var string
	*/
	public $GroupName;
	
	/**
	*@access public
	*@var GroupItem[]
	*/
	public $GroupItems=array();

}

/**
*Interface for DataStrategy Objects
*DataStrategy objects is an effort to make phpchartPlus able to parse
*chart data from multiple sources in a flexible way, that allows 
*expansion with the inclusion of new types of data sources in a totally
*transparent way to the application. To achieve this the concept that varies (the different    
*ways of collecting chart data) is being encapsulated into seperate (Strategy) objects. 
*Transparency is achieved through a common interface for all (Strategy) objects which allows
* the runtime selection of strategy objects  based on some user-defined parameters.
*Users that want to add a new type of data source must implement the DataStrategy_Interface.
*<br>For more info read the Strategy Pattern
*@link http://c2.com/cgi/wiki?StrategyPattern
*@interface
*@author Tsiavos Chris <hide@address.com>
*@license http://opensource.org/licenses/gpl-license.php GNU Public License
*/
Interface DataStrategy_Interface {

	/**
	*Initializes the DataStrategy Object
	*@access public
	*@return void
	*@param mixed $params Passes an arbitrary number of parameters to the Strategy object
	*/
	public function initialize($params=NULL);
	
	/**
	*Performs the required action for parsing the data
	*@access public
	*@return Group[] Common communication structure between DataStrategy objects and DataParser
	*@param mixed $params Passes an arbitrary number of parameters to the Strategy object
	*/
	public function perform($params=NULL); 
	
	/**
	*Finalizes the DataStrategy object.
	*@access public
	*@return void
	*/
	public function finalize();

}

?>
Return current item: phpchartPlus