“Do This, Not That” Now Available!

dtnt

The long wait is over! Do This, Not That: Object Oriented PHP is now available!

(more…)

Wednesday, December 19th, 2012 @ 8:00 am | Comments (0) | Categories: PHP 5, Object-Oriented Development, Best Practices

Improve Your PHP Development Skills

Maybe you struggle with object oriented code, understanding it and writing it. Perhaps you’re tired of having to rewrite code that doesn’t pass code review or introduces a bug you didn’t expect. Maybe you’d like to impress your boss by improving your skills without having to attend an expensive conference.

If any of that describes you, then I have good news: Do This, Not That: Object Oriented PHP is almost here! I’m launching it tomorrow to subscribers to my mailing list, and then on Wednesday to the general public. But here’s the catch: I’m offering a special 20% off launch day deal and it’s only available to people who are members of the launch list!

(more…)

Monday, December 17th, 2012 @ 7:00 am | Comments (0) | Categories: PHP 5, Object-Oriented Development, Best Practices
Tags: , , , , , , , ,

In Further Defense Of Avoiding Private Methods

This is a rebuttal post to comments posted Private Methods Considered Harmful

I do not wholeheartedly believe that private methods are evil, or that they were mistakenly included in the PHP language by the core development team. Nor do I believe that there are only two true options when it comes to devising visibility requirements: public and protected. There is a place for private methods, in PHP development and elsewhere.

(more…)

Tuesday, December 11th, 2012 @ 10:33 am | Comment (3) | Categories: Best Practices, Object-Oriented Development
Tags: , , , , , , , , , ,

Private Methods Considered Harmful

The following is an excerpt from a draft version of Do This, Not That: Object Oriented Development. Sign up today to be the first to get a copy this week!

A few weeks ago, I was tasked with integrating a library that was designed by someone else. This library was intended to access APIs and return the data so that it could be used by my application. This seemed straightforward enough, except that the API I was working with had a few quirks, namely that it interpreted the query string directly, and so it was possible to have a query string similar to this:

(more…)

Monday, December 10th, 2012 @ 6:00 am | Comment (14) | Categories: Best Practices, Object-Oriented Development, Software Development
Tags: , , , , , , , , , ,

July Slides

July was a month of talks and travel, including speaking at OSCON and user group talks to DCPHP and PDXPHP.

For those who saw the “Micro Optimize This!” talk, you can download the slides here.

(more…)

Wednesday, July 28th, 2010 @ 11:28 am | Comment (4) | Categories: Technology, Conferences, System Architecture, PHP 5, Object-Oriented Development
Tags: , , , , , ,

Interfaces Make Testing Easier

I, along with others, have written on interfaces many times before but recently I had occasion to find a new thing about them that makes them really awesome. A few days ago I was tasked with implementing PHPUnit against a Zend Framework application. This application, like many others, makes use of Zend_Auth, and in doing so makes use of the Zend_Auth_Storage_Session class. The problem with unit testing is that sessions aren’t supported very well, and I ran into all kinds of challenges when I tried to use the existing functionality.

But it turns out that Zend Framework includes an interface, called Zend_Auth_Storage_Interface, which defines the methods that must exist in a storage object. The Zend_Auth_Storage_Session class implements this interface (as it’s required to do by the type hinting in the Zend_Auth::setStorage() method). This meant that I could mock a storage object, give my mocked object to the Zend_Auth::setStorage() method, and avoid all the issues surrounding sessions and unit testing. And what’s more, because the interface defined for me the methods that needed to be implemented, I could have confidence that my tests functioned properly.

(more…)

Wednesday, May 26th, 2010 @ 7:00 am | Comment (5) | Categories: Technology, Object-Oriented Development
Tags: , , ,

« Older Entries Newer Entries »

Copyright © 2023 by Brandon Savage. All rights reserved.