 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
Brandon Savage's Blog: Five Tips To Make Good Object-Oriented Code Better
by Chris Cornutt October 28, 2009 @ 07:58:45
Brandon Savage has posted a set of five tips on how you can make your object-oriented code work better and be easier to maintain in the long run.
Last week, I did a talk at the Frederick Web meetup about tips and tricks for improving your object-oriented code. A lot of these tips were adapted from a fabulous presentation by Stefan Priebsch but the ideas are by no means original to him, and they're exceptionally good ideas when you're talking about object-oriented code. Slides are at the end of this blog post, and I'm happy to do this talk over again for local groups.
His list of five is:
- Use Objects. Lots of Objects
- Use Interfaces To Make APIs Predictable
- Use Dependency Injection
- Composition Over Inheritance
- Create Loosely Coupled Classes
voice your opinion now!
oop object tip
WebReference.com: Object Orientated Programming - The beginning
by Chris Cornutt October 14, 2009 @ 07:58:42
New from WebReference.com there's the first part of a tutorial series looking at working with object-oriented programming in PHP:
It is essentially a different way of constructing your applications. Instead of having loose procedures and functions that are meant to serve one purpose, Object Orientated Programming enables you to put data and functions in one container. This container is referred to as an object. An object enables you to model your application as closely as possible to the real world.
They introduce the object - what it is, some of its properties - and include some example code to show how it works. Their sample defines a class and shows how to call methods and set properties on it. They also touch on some of the OOP basics like constructors and inheritance,
voice your opinion now!
oop object introduction tutorial
Ibuildings Blog: Migrating a dev team to an OO team (Part 1)
by Chris Cornutt September 07, 2009 @ 13:28:12
On the Ibuildings blog today Dennis-Jan Broerse has posted the first part of a series he's doing on moving a development team up into the world of object oriented programming.
Being a trainer for Ibuildings, I noticed that the main topic of almost every course plan for customers is object oriented programming. So OO is popular and demand for it is rising. However, while PHP support for OO has been present for a couple of years still many companies that I visit are maintaining and developing procedural applications.
He talks some about how he tries to promote the OOP way of doing things and defines one of the major hindrances for companies to try to move their development towards it - time. The next part of his series will look at ways to help with this.
voice your opinion now!
migrate development oop object oriented
Reinhold Weber's Blog: MVC anatomy for PHP developers
by Chris Cornutt July 28, 2009 @ 11:41:20
Reinhold Weber recently posted what he calls a "simplified approach to explaining MVC [...] to novice programmers" in this recent post to his blog.
Most MVC tutorials require advanced OOP knowledge or that you are familiar with a full-stack framework. The problem with this approach is the target audience they were intended for. Explaining a design pattern to system architects is preaching to the choir.
He targets those just stepping out into PHP and wanting to find out a better way to structure their code than classes and templates all over the place. He explains what MVC is, why you'd want to use it and includes some basic code to illustrate how it could flow in a simple application.
voice your opinion now!
mvc introduction oop framework
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
Joseph Crawford's Blog: MySpace PHP REST Library
by Chris Cornutt April 30, 2009 @ 10:25:55
For those still looking to interface with MySpace, Joseph Crawford has pointed out an official REST library for PHP to connect with their API.
Over the last few days I have been digging deep into the concepts of REST. I have been reading through my copy of RESTful Web Services. Out of curiosity I searched Google for a "php REST library" and it turned up the Official MySpace PHP REST Library.
He points out one interesting thing about it, though - it's like they started using an object-oriented design but build after making the classes with properties. No methods.
Even if they were to choose to go the PHP 5 way I would highly suggest that they do not use classes as containers for constants, there is no need to do this. It is not using proper OOP methodologies. Why create an object that just holds 2 - 4 constant variables, these would be better suited for define() calls in my opinion.
voice your opinion now!
myspace rest library php5 oop constant library
Timothy Boronczyk's Blog: Goto and Exceptions
by Chris Cornutt March 24, 2009 @ 12:57:12
Timothy Boronczyk has written up a nice post about two practical uses of the "goto" syntax in the upcoming PHP 5.3 release of the popular web scripting language.
Yet goto can still be useful under certain circumstances. For example, some programmers use goto to direct the execution flow to dedicated error-handling logic elsewhere in a program in languages that lack exception handling (such as C).
His two examples are to: emulate exception handling in a procedural environment and to overcome perceived limitations with try/catch. He adds in some code comparing the "without goto" and "with goto" versions of the same code showing how the exception handling might be handled differently.
voice your opinion now!
goto exception oop example trycatch
|
Community Events
Don't see your event here? Let us know!
|