I was wondering if you could point me in the right direction to help take my php knowledge further, into the oop side of things.
Thanks in advance.
Moderator: General Moderators
But many common OOP patterns can be implemented in PHP too. A registry is a registry, a singleton is a singleton, MVC is MVC... Granted, the code will look different for obvious reasons, but the principles still stand.Oren wrote:Don't you forget something Buddha443556? We are talking here about PHP (5), not other languages
Exactly.But many common OOP patterns can be implemented in PHP too. A registry is a registry, a singleton is a singleton, MVC is MVC... Granted, the code will look different for obvious reasons, but the principles still stand.
Admittedly, I'm encouraging you and others here to learn the theories and principles of OO Analysis, OO Design and OO Programming. OOP is not bound to any language. An OOP language, such as PHP5, makes it easier to implement an OOD however an OOP language is not required. If you learn the theories and principles of OOP then you'll be able to apply them to any problem using any programming language. That's not such a bad thing for me to encourage, is it? Though maybe off topic.Oren wrote:Don't you forget something Buddha443556? We are talking here about PHP (5), not other languages
Well, I would call it "semi-procedural" as I'm not just writing it for future use but also in order to learn OOP - actually, I don't really need the class I'm working on at all currently - but I'll use it in the future.arborint wrote:I would imagine that Oren's code is mainly procedural as well...
OOP can be used to write large applications. One of the benefits of OOP is reuse, when tackling a project where you can reuse code there maybe a significant benefit (50% increase) to using OOP. However, where code reuse isn't a factor OOP is no better than procedural. Of course, anytime you can reuse design and/or code you'll increase productivity.Oren wrote:I'll be able to write big applications
OOP does not guarantee clean or simple code. Clean and simple code takes discipline and experience.... with a much more clean and simple code
Though I delta'd from your central point which was that neither Procedural or OO guarantee clean, well designed code -- and clean, well designed code is the goal. That's where your "discipline and experience" comment is right on the mark.Buddha443556 wrote:True.
A "real object" is simply anything geneated by a new statement. Just using classes and objects does not mean using OO. The links provided above can explain it better.Oren wrote:P.S arborint: "just namespacing function libraries" - what exactly do you mean and what is considered a real object from you point of view?
Probably a little off topic but ... While code reuse is important, it should be pointed out that it's not the only kind of reuse. Code reuse is probably the simplest and easiest to achieve though.arborint wrote:Though I delta'd from your central point which was that neither Procedural or OO guarantee clean, well designed code -- and clean, well designed code is the goal. That's where your "discipline and experience" comment is right on the mark.Buddha443556 wrote:True.