topical media & game development

talk show tell print

professional-php-04-widget.php / php



  <?php
  require_once(<observable.php>);
  require_once("abstract_widget.php");
  
  dat = new DataSource();
  widgetA = new BasicWidget();
  widgetB = new FancyWidget();
  
  dat->addObserver(widgetA);
  dat->addObserver(widgetB);
  
  dat->addRecord("drum", "$12.95", 1955);
  dat->addRecord("guitar", "$13.95", 2003);
  dat->addRecord("banjo", "$100.95", 1945);
  dat->addRecord("piano", "$120.95", 1999);
  
  widgetA->draw();
  widgetB->draw();
  ?>
  


(C) Æliens 20/2/2008

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.