Reputation: 2053
I know about OOP and how to use it, however because of the way i use there is actually no need for it.
Say i have this
class MyClass
{
function myfunction()
{
echo 'text';
}
}
Well it isn't necessarily the same, but that is what i have in mind. Even though i use OOP, i am not using it right. What i mean is, that i don't need OOP there, and i wan't to learn to make it be needed.
Upvotes: 0
Views: 264
Reputation: 14467
First of all you should determine if it is at all necessary to architecture your project following OOP principles. From my experience almost all projects complexer than a hitcounter could use some form of OOP.
But since you are having trouble understanding how to properly implement OOP principles in your project i'm inclined to think your problem isn't technical in nature but more organizational.
Do you have a clear view on your project or a written brief/spec? What components are there? What data entities? Are databases involved? Do you need to communicate with external webservices? Over soap or rest? Are your going the MVC way?
The answer to all these questions and alot more will make you think of your project from a higher point of view, from there on work down and you'll easily start seeing how you can implement OOP in your project.
It will take some practice and you will make mistakes and decisions you will regret later but that's all part of the learning process.
Do a search on SO for OOP books and you'll find a treasure of information on all things OOP. Clicketyclick: https://stackoverflow.com/search?q=object+oriented+programming+books
Upvotes: 3
Reputation: 18139
The problem here is with "and i want to learn to make it be needed."
I don't think that this is possible to learn. All you need to know (and you seem to have some understanding of it already) is when it is appropriate to use. If all you need to do is echo some text, there is no way to make it necessary to apply the OO paradigm.
Upvotes: 1