05-16-2008, 07:39 PM
|
#2 (permalink)
|
|
The Frequenter
Join Date: Dec 2007
Location: Bucharest, Romania
Posts: 438
Thanks: 3
|
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.
|
|
|
|