note 77785 added to language.oop5.abstract
| From: | 3gon at osu1 dot php dot net | Date: | Thu, 13 Sep 2007 00:26:31 +0000 |
| Subject: | note 77785 added to language.oop5.abstract | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-130443@lists.php.net to get a copy of this message | ||
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.
----
Server IP: 69.147.83.197
Probable Submitter: 89.182.31.191
----
Manual Page -- http://www.php.net/manual/en/language.oop5.abstract.php
Edit -- https://master.php.net/note/edit/77785
Del: integrated -- https://master.php.net/note/delete/77785/integrated
Del: useless -- https://master.php.net/note/delete/77785/useless
Del: bad code -- https://master.php.net/note/delete/77785/bad+code
Del: spam -- https://master.php.net/note/delete/77785/spam
Del: non-english -- https://master.php.net/note/delete/77785/non-english
Del: in docs -- https://master.php.net/note/delete/77785/in+docs
Del: other reasons-- https://master.php.net/note/delete/77785
Reject -- https://master.php.net/note/reject/77785
Search -- https://master.php.net/manage/user-notes.php