Revisiting: Why Every Developer Should Write Their Own Framework

In November of 2009, I wrote about why developers should write their own frameworks. I pointed out at the time that often developing a framework forces developers to make the kinds of architectural choices that frameworks require, which helps them better understand the architectural choices in the most popular frameworks.

I haven’t stopped believing in the power of doing as a learning tool. But in the past few months I’ve had an opportunity to move into more of an understanding of frameworks like Zend Framework, and I’ve come to another realization:

(more…)

Monday, May 24th, 2010 @ 7:00 am | Comment (8) | Categories: Object-Oriented Development, Open Source, Zend Framework, Technology
Tags: , , , ,

A Lesson In Static Methods And Late Static Binding

Until last week, I had never experienced what must have been incredibly frustrating to most developers: the fact that the self keyword in PHP refers to the class it is located in, and not necessarily a class that extends it. I personally ran into this problem when trying to extend Zend_Auth. Being a singleton, the constructor in Zend_Auth is protected, and the static method Zend_Auth::getInstance() instantiates itself. The problem is, when extended, My_Auth::getInstance() still returns an instance of Zend_Auth. The solution was to duplicate the static method in my My_Auth class, which worked properly. For example:


(more…)

Monday, April 12th, 2010 @ 7:00 am | Comment (4) | Categories: PHP 5, Object-Oriented Development, Zend Framework, Technology
Tags: , , , ,

The Registry Pattern Reexamined

Last July, I wrote about the registry pattern and some of its advantages. These advantages include the ability to access objects across different areas of your application, and the storage of objects for later retrieval.

Much of the debate in the comments focused on whether or not the registry pattern was suitable for today’s object-oriented development, and some of the arguments focused on whether or not the “global scope” was a good place to have objects.

(more…)

Friday, March 26th, 2010 @ 7:00 am | Comment (15) | Categories: Best Practices, Object-Oriented Development, Technology
Tags: , , , , , ,

Why Active Record Isn’t A Bad Design Pattern

Were I writing this as an article for a newspaper, the subhead would be “Design Patterns Don’t Cause Application Slowness.” The point of this piece isn’t to defend Active Record per se; it’s to discuss the fact that design patterns aren’t to blame for your application’s problems, and more to the point, design patterns aren’t the problem.

This discussion stems from a discussion with a friend of mine who swore up and down that Active Record was a terrible design pattern that was inefficient, poorly designed, and ill-suited for use by developers. As a PHP developer, it’s easy to embrace this call, especially since it’s always fun to trash Ruby on Rails folks; however, I’m not willing to take the position that design patterns are the cause of performance problems.

(more…)

Tuesday, March 16th, 2010 @ 9:00 am | Comment (9) | Categories: Best Practices, System Architecture, Object-Oriented Development, Technology
Tags: , ,

Cool DateTime Functions In PHP 5.3

Over time, the PHP DateTime object has become one of the best objects available to PHP developers. This object has grown since early PHP 5 into a robust class that has the ability to do lots of great things.

Recently, I was exploring some of the functionality provided by the DateTime object as of PHP 5.3 (and wishing that Ubuntu had PHP 5.3 as a package distribution). Here are some of the new things in PHP 5.3 that are really cool.

(more…)

Monday, January 25th, 2010 @ 1:00 am | Comment (11) | Categories: PHP 5, Object-Oriented Development, Technology
Tags: , , , , , ,

Five (Good) Lessons The Government Teaches Us About Object-Oriented Programming

As Benjamin Franklin once famously said, “the only two things that are certain in life are death and taxes.” His point, while political, has a good perspective on one of life’s ever-persistent truths: the fact that governments exist in every country, and, largely, they have some of the same benefits and drawbacks everywhere.

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.

(more…)

Wednesday, December 2nd, 2009 @ 1:00 am | Comment (1) | Categories: Best Practices, Object-Oriented Development, Technology, Uncategorized
Tags: , ,

« Older Entries Newer Entries »

Copyright © 2024 by Brandon Savage. All rights reserved.