Archive for October, 2009

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