dynamic classes or dynamic extends ?
| From: | Torsten Rosenberger | Date: | Wed, 02 Jul 2003 11:00:42 +0000 |
| Subject: | dynamic classes or dynamic extends ? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-153688@lists.php.net to get a copy of this message | ||
Hello
i plan to reorganize my CMS code.
The idee is to only use classes for the hole system.
There should be a Core class to handle the whole functionality
(Login, Backend, Permission, Modules)
Every Module as a class (News, Pictures ...)
the construct should be like this
class Core extends Backend {
}
class Backend extends News {
}
class News {
}
if i have more modules as only one class Backend must extends News,
Pictures ....
i could make a temp class to extend the Module only if the module is
called
class Backend extends Temp {
}
rquire_once 'class to inlude in case of Module'
--- file for class News ----
class Temp extends News {
}
class News {
}
--- file for class Picture ---
class Temp extends Picture {
}
class Picture {
}
in this case I must always write the Temp class in every Module Class
maybe there is a ohter solution for this ?
I'm working with ITX_Templates, DB from PEAR and wenn i split the
classes i must always assign the objects to the other classes.
BR Torsten