|
Posted by Willem Bogaerts on 07/25/07 07:20
> When will php support:
>
> class My_Best_Class
> {
> }
> define('MyClass', 'My_Best_Class');
> $o = new MyClass; // use MyClass as aliasname of My_Best_Class?
Never, I hope. If you cannot even trust your identifiers, all hope of
maintaining code is gone forever.
Especially the example is stunning. This has nothing to do with object
orientation. If you do this the object-oriented way, you can use
factories, interfaces and subclasses.
Off course, a factory is a method (or a function), so you can SEE that
it is defined elsewhere. And you can even pass it parameters.
Best regards,
--
Willem Bogaerts
Application smith
Kratz B.V.
http://www.kratz.nl/
Navigation:
[Reply to this message]
|