Hi Daniel,

Most OOP projects contain multiple hierarchies, not just one. Normally DB
is not made the base class. Think in terms of whether the objects have
is-type-relationships or use-part-relationships.

Eg.

Boring_News uses-the-part MySQL_DB, so Boring_News uses the MySQL_DB object
as a member var.

class Boring_News { $var db; ...  }

Sexy_Articles is-a-type-of News, so perhaps Sexy_Articles can be derived
from the News class.

class Sexy_Articles extends News { ... }

Hope this helps.

Bye, John

Daniel Harik <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> 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:[EMAIL PROTECTED]
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to