Different class implements one interface
|
<?php
class Person { public $name; function __construct( $name ) { $this->name = name; print "Person constructed with $namen"; } }
interface Command { function execute(); }
class FtpCommand implements Command { function setHost( $host ) { print "FtpCommand::setHost(): $hostn"; }
function setUser( $user ) { print "FtpCommand::setUser(): $usern"; }
function execute() { } }
class PersonCommand implements Command { function setPerson( Person $person ) { print "PersonCommand::setPerson(): {$person->name}n"; } function execute() { } }
?>
|
|
|
|
|
HTML code for linking to this page:
Related in same category :
-
|