Posts Tagged ‘Web Development’

Zend_Navigation makes writing Navigation for ZF Sites Very Easy

January 15th, 2010

Today, has been a very productive day for me. Part of it was spent on picking up Zend_Navigation which, thanks to Jon Lebensold’s Zend Cast on the subject of using Zend_Navigation to create menus, sitemaps and breadcrumbs, was easier than I had expected.

Zend_Navigation makes the management of a web site’s navigation very easy as it allows you to programmatically create the navigation bar by specifying either the URI or Controller, Action and Module properties of a Zend Navigation Page.

To use Zend Navigation, all I had to do was the following:

  • Add configuration entries for navigation in the application.ini file.
  • Initialise and attach an instance of the Zend_Navigation container class to the navigation helper via the view in the bootstrap.
  • Display the navigation bar with Zend_View_Helper_Navigation::menu() or the BreadCrumbs with Zend_View_Helper_Navigation::breadcrumbs() in your layout.phtml file.

» Read more: Zend_Navigation makes writing Navigation for ZF Sites Very Easy

Started Draft Post on Zend Framework, Doctrine & PHPUnit Setup

January 13th, 2010

Today as I unit tested my view scripts using asertXpath() via Zend_Test, I was thinking how far along I’ve come from writing notes whilst reading books on what the difference between Aggregation and Composition is, then posting confused questions on the Advanced PHP forum at SitePoint. People are very generous with information and happily help out – they just give and give.

» Read more: Started Draft Post on Zend Framework, Doctrine & PHPUnit Setup

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