 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
Timothy Boronczyk's Blog: What's Wrong with OOP
by Chris Cornutt June 11, 2009 @ 08:44:05
In this new post to his blog Timothy Boronczyk has a few suggestions about what's wrong with the current implementation of object oriented programming in most languages (including PHP).
Proponents of Object Oriented Programming feel the paradigm yields code that is better organized, easier to understand and maintain, and reusable. [...] If objects truly model the way people think of things in the real world, then why do people have a hard time understanding and working in OOP? I suspect the problem might be the focus on objects instead of actions.
He goes on to explain that, in his opinion, the functionality would be more understandable if it focused on the actions from the user's point of view rather than what the object itself can do.
The way some OOP languages (like Java and C#) force objects on the programmer borders on the absurd. [...] Sadly though, that decision isn't left to the programmer who has been tasked with developing and maintaining a system.
voice your opinion now!
action objectoriented oop wrong
TheWebSqueeze.com: PHP5 Abstraction for the Rest of Us
by Chris Cornutt May 29, 2009 @ 12:07:27
If you're a PHP developer and haven't made the jump to object-oriented programming yet, you definitely need to check out this extensive tutorial from thewebsqueeze.com. It's packed with plenty of OOP and wants to teach it all to you.
This tutorial aims to remove some of the curly-brace-filled haze that often surrounds OOP and by the end of this lesson you will have created a class, instantiated an object, given inheritance to some children and come to understand why OOP is such a powerful tool to have at your disposal. If you have no idea what any of the above means but are shaking with a desire to find out, read on as we look at Abstraction for the rest of us.
They work from the ground up - defining classes, setting properties with visibility, adding methods and a constructor, extending classes and using static methods/variables. They haven't updated it with the new namespace operator ("\" instead of "::") but other than that, it's a great overview. There's even some type checking and input filtering to round out the code examples.
voice your opinion now!
beginner tutorial objectoriented oop
IBM developerWorks: Build seven good object-oriented habits in PHP
by Chris Cornutt October 31, 2008 @ 07:51:59
The IBM developerWorks website has a few suggestions - seven of them, in fact - that they think can help make you a better PHP programmer.
With PHP's object-oriented (OO) language features, if you aren't already creating your applications with OO principles in mind, these seven habits will help you get started in the transition between procedural programming and OO programming.
Each of the seven OOP habits have more details below them, but here's the short list:
- Be modest.
- Be a good neighbor.
- Avoid looking at Medusa.
- Embrace the weakest link.
- You're rubber; I'm glue.
- Keep it in the family.
- Think in patterns.
In each there's a "bad habit" and a "good habit" to explain the concept a bit more fully, everything from error handling to interfaces.
voice your opinion now!
oop objectoriented tutorial seven habit pattern error handling cohesion
PHPFreaks: OO PHP Parts One & Two
by Chris Cornutt June 09, 2008 @ 08:48:00
PHPFreaks has posted part one and part two of a new series they're working on to introduce those new to the language to the concepts of object-oriented programming in PHP.
On the old site, I started a series of tutorials named "PHP Application Design". I planned for at least three parts, and while I did publish the first two and wrote at least half of part three, I found myself out of time to make it to the finish. Still dedicated to writing reusable and extensible PHP code and spreading the knowledge, this is a restart of the series, renamed as simply "OO PHP"
In part one he looks at the basics of OOP (terms, defining properties/methods, autoload, exceptions, type hinting, etc) with some code examples sprinkled through out. Part two looks at the "boring OOP principles" like polymorphism, encapsulation and heuristics.
voice your opinion now!
objectoriented programming tutorial principles introduction
Matthew Weir O'Phinney's Blog: PHP globals for the OOP developer
by Chris Cornutt May 25, 2007 @ 10:35:00
Matthew Weir O'Phinney has two new posts that talk about something object-oriented developers seem to shy away from - globals in their classes and how they can make things more difficult to make "embeddable applications" a reality.
In my previous entry, I ranted about the use of globals in popular PHP applications, and how they make embedding said applications difficult. I develop using object-oriented practices, and can honestly say I can't recall ever having slung a global variable around in my own code. Globals seem hackish to me, and as a result, trying to get applications that use them to behave correctly has been a challenge.
In the first part, he notes an interesting find about the $GLOBALS value and illustrates with a code example how he was able to get around it in his instance (wrapping a Serendipity instance in a Zend Framework app).
In part two, though, and uses another code example to show what kind of issues he was seeing with the $GLOBALS - a script that sets some globals in different instances and echoes the results back out.
voice your opinion now!
globals objectoriented developer example globals objectoriented developer example
|
Community Events
Don't see your event here? Let us know!
|