Archive for the ‘Web Development’ category

Unit Testing & TDD Keeps you focussed and gives you Peace of mind

January 12th, 2010

Most of my day was spent on developing the User Model Layer for an application that my team and I are currently developing at DevProducts HQ. I’d like to briefly talk about how we are using TDD and discuss one major benefit that this method of development provides for my team and I during development.

While TDD has many benefits, my favourite is that it helps to keep me and the other developers on my team focussed on the components we have chosen to work on. Not only that, but it helps us focus on the task at hand as it forces us to think about each unit of the component and write it so that it _can_ be tested – as much as I’d like to expand on TDD itself, for this post, I’m just going to explain how it could help you keep focussed.

How does it keep you focussed?

» Read more: Unit Testing & TDD Keeps you focussed and gives you Peace of mind

How would you handle this? – Service Layer slowly getting polluted (or so it seems)!

October 21st, 2009

Just going through the motions here using Zend Framework and an implementation of Service Layer and Domain Model to form my domain layer.

I must admit – I thought I had made a break through, but alas, more analysis paralysis.

I’m finding that I’m abusing the accessiblity of the Service Layer.

Here’s an example:

  • I’ve got an application which manages users.
  • I have a User Model and have User Service as the pivot point where application logic gets ported to to business logic.

» Read more: How would you handle this? – Service Layer slowly getting polluted (or so it seems)!

Test Results on Memory Usage of Zend Framework and Doctrine with APC

October 10th, 2009

After investigating a recommendation to use Doctrine by a fellow blogger, Brian at Real of Zod, I have decided to run with Doctrine as my Domain Model in Zend Framework projects. The thing is, if I’m going to commit to this, I need to know that applications I build in the future with the Zend Framework while using Doctrine as an integral part of the Model layer will not take performance hits from things like memory usage.

With Doctrine doing a _lot_ of magic, I thought that this would be something that I wanted to see for myself.

4MB Memory to execute a simple Query?!?! Ffffff#$#!!!!

A quick google search took me to a Question posted on StackOverflow about Doctrine Memory Usage. The concerned OP was asking if he had a server misconfiguration or if this was normal for Doctrine to be using so much memory for a simple query. He posted a 4MB difference in Peak Memory Usage between the start of the request before the Doctrine Query was executed and after the Doctrine Query was executed. After reading that, I was a little nervous.

» Read more: Test Results on Memory Usage of Zend Framework and Doctrine with APC

Zend Framework Model – Research into Possible Domain Model Solutions

October 1st, 2009

I’ve managed to spend some time sitting back and looking over some of hte projects I’ve worked on for the past year or so with the Zend Framework and decided that it was finally time to look into something that has always bugged me since the old Cubix Framework days.

That was the lack of decoupling of my Model layer from the View and Controller layers of my MVC projects. Don’t get me wrong, the applications we’ve written work and work well, but the perfectionist in me simply just refuses to stop trying to mentally refactor old projects.

From the time I had first conceptualised the our in-house MVC framework: Cubix and this is before switching to Zend, something that has left me in Analysis paralysis is the Model layer.

I mean, most things I’ve read usually mention the Model layer as a representation of your applications business logic, but this is left wide open to interpretation. The difficult thing here is, that because the business logic is so specific to projects, there’s no real way of explaining it aside from some really basic examples which turn out to be the equivallent of a Javascript example of: “Hello World.”

» Read more: Zend Framework Model – Research into Possible Domain Model Solutions

Remembering Field/Column widths in DojoX Datagrid Component

July 11th, 2009

We had to do implement a workaround for a limitation in the Dojox DataGrid component that does not have an easy way of remembering datagrid column widths adjusted by the user.

This took some time to actually get my head around, but I have managed to “will” this solution into existance. I say “will” because i’m not too happy with the implementation. It’s a workaround that works for the mean time anyway.

I’ve written the description here on the “DevProducts on Blogger” blog – Check out the post for more info: Persistent Column Widths in Dojo (dojox) DataGrids