note 77784 deleted from language.oop5.abstract by nlopess
| From: | nlopess@php.net | Date: | Thu, 13 Sep 2007 10:21:35 +0000 |
| Subject: | note 77784 deleted from language.oop5.abstract by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-130454@lists.php.net to get a copy of this message | ||
Note Submitter: 3gon
----
Thanx well 4 all these impressions!
In my opinion the thing is clear like this:
<?php
abstract class AbstractClassForAlBundy
{
//Question of Definition
protected $priority;
protected $message = array('','','','','');
protected $environment;
protected $syslogKind;
protected $config;
protected $global;
protected $classes;
protected $super;
protected $getdata;
public function __construct(array &$config)
{
$this->config = $config;
}
public function getValue($priority,$syslogKind, $getdata)
{
$this->priority = $priority;
$this->syslogKind = $syslogKind;
$this->getdata = $getdata;
$this->example = $exaMPLE;
}
// Force Extending class to define these methods
abstract protected function CheckGet(Environment &$environment);
abstract protected function DecryptGet(Environment &$environment, $example);
abstract protected function ShowSite(Environment &$environment, $id);
abstract protected function CheckPost(Environment &$environment);
abstract protected function EncryptPost(Environment &$environment, $example);
abstract protected function LogEvents(Environment &$environment, $syslog);
abstract protected function DBConnectWrite(Environment &$environment);
abstract protected function DBRightsCheck(Environment &$environment, $config);
abstract protected function ExportImportFunctions(Environment &$environment, $config);
abstract protected function GoOnShowSite(&$class, $method,$args);
/* COOOOL
abstract protected function writeToDatabase(Environment &$environment);
abstract protected function writeToSystem(Environment &$environment);
abstract protected function writeToEmail(Environment &$environment);
abstract protected function writeToMobile(Environment &$environment);
abstract public function execute(&$class, $method, $args); */
protected function environment(Exception &$object) {
$this->super =& new Environment($object, $this->config);
$this->global = $this->super->env();
$this->global = $this->global['environment'];
return $this->super;
}
public function __destruct()
{
unset($this);
}
}
I´m not so strong at syntax, but Abstraction in PHP5 should use as an Environment-Translator.
You have always to declare the abstract functions in child classes, so you can backtrace the way of
data more easily in a diagram or something.
If you use interfaces, it is more difficult to work with constant values, because the naming of
variables in relation to an function coulb be a bit more cryptic.
A class definition is more variable, i think.