How to think OOP ?
View Single Post
05-17-2008, 06:00 AM
Join Date: Sep 2007
Originally Posted by
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 can only agree with you on that
View Public Profile
Send a private message to Kalle
Visit Kalle's homepage!
Find More Posts by Kalle