News Feed
Jobs Feed
Sections



Recent Jobs

News Archive
feed this:

Dennis Hotson's Blog:
PHP Object Oriented Programming Reinvented
September 23, 2010 @ 12:43:39

Dennis Hotson has a new post to his Tumblr blog about what he calls PHP object-oriented programming reinvented - a chunk of code he's created that lets you build classes out of objects.

It's tentatively called "PHP Object Oriented Programming Reinvented". Although it turns out the acronym is kind of unfortunate. I'm still working on that... The main idea is that classes aren't really very special at all, they're just objects like everything else. They don't even have names.. you give your class a name by giving the variable it's assigned to a name.

He includes a code snippet that shows the creation of a sample class (the "class" class) and extend it with a new class of "animal"....and then extend that with a class for a "dog". You can take a look at the full code for the method here.

1 comment voice your opinion now!
object oriented programming reinvented



Brandon Savage's Blog:
5 (Good) Lessons The Government Teaches Us About Object-Oriented Programming
December 02, 2009 @ 12:11:55

Brandon Savage has taken some of the good practices in object oriented application development and related them to some of the things that the government can teach you about them:

However, the ubiquity of governments around the world also gives us a unique opportunity to learn some lessons from them as developers, particularly about principles of object oriented programming. Governments serve as perfet object lessons (pun intended), demonstrating some of the good, the bad, and the ugly object-oriented practices we see.

He looks at five topics - abstraction, encapsulation, implementation of dumb objects, decoupling and the concept of "one class, one responsibility".

0 comments voice your opinion now!
government opinion object oriented


Brandon Savage's Blog:
Q&A Answering Some Questions About Object-Oriented Programming
October 30, 2009 @ 09:20:52

Brandon Savage has posted the answers to some questions that were raised by a previous post of his on object-oriented development and some best practices. In this new post, he answers the questions:

  • "Often times when a developer gives each object only one responsibility, they tightly couple objects together." Can you explain?
  • I do not know about dependency injection '" do you have any links that do not require subscription?
  • Can you please explain 'one object '" one job' concept?

Each question is answered, sometimes with code included, to help resolve any confusion about how to correct use object oriented practices in your applications.

0 comments voice your opinion now!
oop object oriented programming questions


Ibuildings Blog:
Migrating a dev team to an OO team (Part 1)
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.

0 comments voice your opinion now!
migrate development oop object oriented


Blue Parabola Blog:
Objectively Oriented
February 18, 2009 @ 09:31:30

On the Blue Parabola blog, Matthew Turland takes a look at object-oriented programming and what core concepts lie at its heart.

What is object-oriented programming? The acronym OOP has become a bit of a buzzword in the current age of programming, to the point where the waters of its definition have become rather murky. [...] PHP may not be object-oriented, but from a purist perspective, neither is Java. What do I mean by "purist perspective?" Plain and simple: everything is either an object or a message being passed between objects (where message parameters are also objects).

He mentions one of the first languages to support objects (Simula) and the four fundamental concepts that would make a language truly OOP - abstraction, inheritance, encapsulation, polymorphism. Its his opinion, though, that while its good for languages to adhere to these four principles as much as they can, discussions about how well they adhere to them is usually just "spinning your wheels" and don't have much use.

0 comments voice your opinion now!
object oriented definition abstraction inheritance encapsulation ploymorphism


Michael Kimsal's Blog:
PHP is not object oriented!
February 12, 2009 @ 08:44:10

One complaint that Michael Kimsal has about the PHP language - "PHP is *not* object oriented":

Goodness. I like PHP. I use it a lot. I've been using it since early 1996. I'm Zend Certified, have done billion dollar ecommerce projects in PHP, and like to think I know a little bit about PHP. It is *NOT* "object oriented". I wish people would quit saying it. Perhaps there's a need to impress non PHP people, or to try to get across the idea that PHP supports objects. Maybe that's fair, but I don't think so.

His reasoning is that, despite the phrase "object oriented" being applied to PHP, its functionality does not hinge on objects. He suggests a "more correct" term to replace it - "object capable". This shows that PHP can use objects but, because of its procedural roots, doesn't have to.

0 comments voice your opinion now!
object oriented capable incorrect opinion php5


Community News:
PHP 5.3beta1 Announced
January 29, 2009 @ 07:56:05

The first step towards a full, stable release of the next version of PHP - 5.3 - has officially been made - the first beta (PHP 5.3beta1) has been released and is now available for download.

The biggest change is dropping of OO functionality in closures as full OO support for closures is planed for a later release than PHP 5.3.0. See http://wiki.php.net/rfc/closures/removal-of-this. This release marks the begin of a feature freeze and bug fix only phase. If in doubt whether your change is a bugfix please run it by Lukas and me.

You can download the packages here:

0 comments voice your opinion now!
php5 beta download release object oriented closures feature freeze


NETTUTS.com:
Learning OOP in PHP ASAP!
January 20, 2009 @ 09:36:36

NETTUTS.com has posted an introduction (using the Car analogy, of course) to teach you how to use the basics of object-oriented programming in PHP.

PHP is so much more than a scripting language. It's a full-fledged language capable of building very complex applications. By harnessing the full power of Object Oriented Programming, you can reduce the amount of time you spend coding and use it to build better websites. This tutorial will show you how.

They explain objects, inheritance, encapsulation and polymorphism briefly before "getting their hands dirty" with some actual OOP PHP code. Their code example sets up a thumbnailer class - one that takes in an image, a height/width you want to resize it to (as properties) and splits it back out the other side.

As always, you can grab the source or view the demo to see it work.

0 comments voice your opinion now!
tutorial thumbnail oop object oriented introduction


Brandon Savage's Blog:
Keeping Superglobals Out Of Classes
December 08, 2008 @ 07:57:24

In a new post to his blog, Brandon Savage makes a suggestion that could help in maintenance and debugging down the road - keep those superglobals out of your classes.

Let's ignore the security implications of the above code for just a moment, and focus on just the use of the superglobal. By using the $_POST superglobal array, we're effectively doing two things [in the example code]: relying on the field names and limiting code reuse.

He shows how to refactor the example into something a bit more reusable by changing the method call to pass in the given username and password instead of looking to the global for it. He does note, however, that there are some more correct uses for those superglobals:

There are some legitimate uses of superglobals in classes. One example is the use of the $_SESSION superglobal, which is often used for things like a user object. But I urge you to do so sparingly, when appropriate, rather than relying heavily on superglobals which are subject to change and may not give you the data you expect.
0 comments voice your opinion now!
class object oriented superglobal refactor reuse


NETTUTS.com:
Real-World OOP With PHP and MySQL
November 26, 2008 @ 11:41:47

On the NETTUTS.com site, there's a new tutorial that looks to be a basic introduction to the world of Object-oriented programming in PHP.

Numerous examples from robots to bicycles have been offered as "easy" explanations of what OOP is. I've opted to show you how OOP works with a real-life example, for a programmer. By creating a MySQL CRUD class you can easily create, read, update and delete entries in any of your projects, regardless of how the database is designed.

Their CRUD example not only serves as an introduction to OOP, but can also be an introduction to MySQL support for those that haven't used it before. They create six functions - the four for CRUD and a connect and disconnect. The full source is available for download too.

0 comments voice your opinion now!
oop object oriented tutorial crud database mysql



Community Events





Don't see your event here?
Let us know!


api application test development podcast language conference framework interview phpunit unittest introduction series community opinion custom manifesto package symfony2 release

All content copyright, 2012 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework