Re: Design for Large OO poject
| From: | Julio Nobrega Trabalhando | Date: | Thu, 08 Nov 2001 17:27:04 +0000 |
| Subject: | Re: Design for Large OO poject | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-73919@lists.php.net to get a copy of this message | ||
If I am not mistaken, the correct name for your wrong approach (at least
in PHP) is multiple inheritance.
PHP doesn't support multiple inheritance, only one level.
So you do can extend one class but not extend the second one from the
first.
Ie:
> class DB{}
Works.
> class Member extends DB()
Works.
> class News extends Member{}
Doesn't work. Extending an 'extend' class.
http://www.php.net/manual/en/keyword.extends.php
As for the CMS, good luck :-)
One advice, doesn't go too much OO. Depending on the number of features
you plan to use, it might affect performance.
And one word of caution, code it faster because my own open source cms is
coming soon ;-))))
--
Julio Nobrega
A hora está chegando:
http://toca.sourceforge.net
"Daniel Harik" <gatop@hot.ee> wrote in message
news:1343024288.20011108182448@hot.ee...
> Hello guys,
>
> I've started large long-term project, i'm buildingd my own CMS (content
> manegment system) with few more developers, compared to nuke i want
> it to be fully object-oriented, so that adding more modules would be
> easy and logical, i have built first beta version of it, i want to
> maximize code reuse, so here is the structure of my classes
>
> class DB{}
> class Member extends DB()
> class News extends Member{}
> class Poll extends News{}
> ...........................
> All new blocks and modules are added
> in this place
> ...........................
> class NewBlock extends BitOlderBlock{}
>
> after this comes the class that's always in the end
>
> class Blocks extends NewBlock{}
>
> then i have a file that uses all this library
>
> looks like this:
> ---------------
> <?
> include ("blocks.php");
> class mainPage extends Blocks{
>
> function displayMainPage(){
> $this->heading();
>
> $this->block_news();
>
> $this->footer();
> }
>
>
> }
> $page = new mainPage;
> $page->displayMainPage();
> ?>
>
>
> --------------
>
>
> I'm very new for big Object-oriented projects, but i'm not new to PHP,
> i was wondering if my design is good or bad, if you could show me
> what's wrong with it i'd be very thankful
>
> Thank You very much, and have a nice day :-)
>
>
>
>
>
>
>
> --
> Best regards,
> Daniel mailto:gatop@hot.ee
>