[ class tree: phpchartPlus ] [ index: phpchartPlus ] [ all elements ]

Source for file DataStrategy_Interface.php

Documentation is available at DataStrategy_Interface.php

  1. <?php
  2.  
  3. /*
  4. **************************************************
  5. Class: DataStrategy_Interface.php
  6. **************************************************
  7. Author: Tsiavos Chris <jaames@freemail.gr>
  8. Date: October 2004
  9. **************************************************/
  10.  
  11. class DataStrategy_Exception extends Exception {
  12.  
  13. function DataStrategy_Exception($data) {
  14. Exception::__construct($data);
  15. }
  16. }
  17.  
  18. /**
  19. *Composes the Group class
  20. *@author Tsiavos Chris <jaames@freemail.gr>
  21. *@license http://opensource.org/licenses/gpl-license.php GNU Public License
  22. */
  23. class GroupItem {
  24. /**
  25. *@access public
  26. *@var string
  27. */
  28. public $ItemName;
  29. /**
  30. *@access public
  31. *@var integer
  32. */
  33. public $ItemValue;
  34. }
  35.  
  36. /**
  37. *Represents a group of items
  38. *@author Tsiavos Chris <jaames@freemail.gr>
  39. *@license http://opensource.org/licenses/gpl-license.php GNU Public License
  40. */
  41. class Group {
  42.  
  43. /**
  44. *@access public
  45. *@var string
  46. */
  47. public $GroupName;
  48. /**
  49. *@access public
  50. *@var GroupItem[]
  51. */
  52. public $GroupItems=array();
  53.  
  54. }
  55.  
  56. /**
  57. *Interface for DataStrategy Objects
  58. *DataStrategy objects is an effort to make phpchartPlus able to parse
  59. *chart data from multiple sources in a flexible way, that allows
  60. *expansion with the inclusion of new types of data sources in a totally
  61. *transparent way to the application. To achieve this the concept that varies (the different
  62. *ways of collecting chart data) is being encapsulated into seperate (Strategy) objects.
  63. *Transparency is achieved through a common interface for all (Strategy) objects which allows
  64. * the runtime selection of strategy objects based on some user-defined parameters.
  65. *Users that want to add a new type of data source must implement the DataStrategy_Interface.
  66. *<br>For more info read the Strategy Pattern
  67. *@link http://c2.com/cgi/wiki?StrategyPattern
  68. *@interface
  69. *@author Tsiavos Chris <jaames@freemail.gr>
  70. *@license http://opensource.org/licenses/gpl-license.php GNU Public License
  71. */
  72. Interface DataStrategy_Interface {
  73.  
  74. /**
  75. *Initializes the DataStrategy Object
  76. *@access public
  77. *@return void
  78. *@param mixed $params Passes an arbitrary number of parameters to the Strategy object
  79. */
  80. public function initialize($params=NULL);
  81. /**
  82. /**
  83. *Performs the required action for parsing the data
  84. *@access public
  85. *@return Group[] Common communication structure between DataStrategy objects and DataParser
  86. *@param mixed $params Passes an arbitrary number of parameters to the Strategy object
  87. */
  88. public function perform($params=NULL);
  89. /**
  90. /**
  91. *Finalizes the DataStrategy object.
  92. *@access public
  93. *@return void
  94. */
  95. public function finalize();
  96.  
  97.  
  98.  
  99. ?>

Documentation generated on Sun, 3 Oct 2004 14:59:14 +0300 by phpDocumentor 1.3.0RC3