How to think OOP ?
View Single Post
05-16-2008, 07:39 PM
Join Date: Dec 2007
Location: Bucharest, Romania
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.
The Following User Says Thank You to xenon For This Useful Post:
View Public Profile
Send a private message to xenon
Visit xenon's homepage!
Find More Posts by xenon