Abstract And Static Method
<p>I am creating a database connection class as an abstract in the super-class. Am using PDO in php. I want to make it abstract so that i can declare specific database connection sub-classes for mysql, oracle, postgre, etc.</p>

<p>I have a connection method in the abstract super-class that i have also declared as abstract. My problem now is, can i make this connection method also static in the sub-class? I want to know if it is the right thing to do.</p>

<p><strong>EDIT</strong></p>

<pre><code>//SUPER CLASS
abstract protected function connectToDatabase($hostname, $dbName, $userName, $password="");


// SUB CLASS
public static function connectToDatabase($hostname, $dbName, $userName, $password=""){

        $this-&gt;setHostName($hostname);
        $this-&gt;setDbName($dbName);
        $this-&gt;setUserName($userName);
        $this-&gt;setPassword($password);
        $this-&gt;setDatabaseType(DATABASE_TYPE);
        $dsn = $this-&gt;getDatabaseType(DATABASE_TYPE) . ":" . parent::getHostConst() . "=" 
              . $this-&gt;getHostName() . ";" . parent::getDbNameConst() . "=" . $this-&gt;getDbName();
        $pdo = new PDO($dsn, $username, $passwd);
        $this-&gt;setPdoConnection($pdo);
}
</code></pre>
