View Single Post
Old 05-16-2008, 07:39 PM   #2 (permalink)
xenon
The Frequenter
Newcomer 
 
xenon's Avatar
 
Join Date: Dec 2007
Location: Bucharest, Romania
Posts: 438
Thanks: 3
xenon is on a distinguished road
Default

You're thinking the wrong way. Not everything should be a class. Why? Because not everything must be thought in terms of OOP. Why instantiate a class to define some constants when you can do that without a class? Or why instantiate another class to include and configure some libraries, when that's completely unnecessary? Unlike Java, in PHP you have a choice. Use it wisely, though. Group libraries in classes, and combine that with design patterns. This is called, in one word, MVC.

This is the problem with people new to classes. They think 'hey, I can build a class to do that, why use procedural code?'. That's the way I was thinking when I first discovered OOP, and took me some time to figure what to do and what not to do in an OOP-manner. Study, and implement.
__________________
I have optimistic thoughts, even though sometimes (if not always) life's a bitch.
xenon is offline  
Reply With Quote
The Following User Says Thank You to xenon For This Useful Post:
xperience (05-21-2008)