Decoupling models from the database: Data Access Object pattern in PHP

Monday, January 5th, 2009

Nowadays it's a quite common approach to have models that essentially just represent database tables, and may support saving the model instance right to the database. While the ActiveRecord pattern and things like Doctrine are useful, you may sometimes want to decouple the actual storage mechanism from the rest of ...

Thoughts on unit testing and application design

Thursday, December 11th, 2008

Here are some thoughts and observations regarding application design and unit testing in the quiz-project I recently wrote about. When I was writing the Amazing Programming Language Guessing Script, I didn't first write any unit tests. Partially because I just wanted to test something quickly, partially because I didn't think there ...

Creating a Dojo dijit.Tree with checkboxes

Friday, November 21st, 2008

Dojo provides a useful component called dijit.Tree, which is basically a quite typical tree component. However, it doesn't do much out of the box, and I needed it to make some tree nodes selectable with checkboxes for my Zend Framework based packageizer script. While Zend Framework has a Zend_Dojo component, ...

Code

Friday, November 23rd, 2007

Codeutopia.net public SVN repository Contains various tidbits I've written in PHP and JavaScript. All code © me, but you are free to use and modify them as you see fit, as long as you give credit to me. If you use my code, let me know (see Contact page), as I'd ...