Extend or custom class

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
user___
Forum Contributor
Posts: 297
Joined: Tue Dec 05, 2006 3:05 pm

Extend or custom class

Post by user___ »

Hi guys,
I wonder whether it is better to create your application with extend or with a custom class(which does the same as extend.
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

umm I'm not sure I understand your question... an application is usually composed of more than one class.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

There are times when extending a base class is the best choice; other times when creating a new class is the best choice; a third path is composition where you pass an object to another object that uses it to add to its functionality without inheritance. One is not better than another.
(#10850)
Post Reply