Invisible to the eye's Image
More about this blog
Latest Post
11 Mar 2010
Total Posts
74
Readers
269
Liked
0
Disliked
0
Views-Per-Post
03.64
vote up
0
vote down

Standard Php Library and coupling

The Standard PHP Library is an object-oriented library, by default always included in the latest versions of php. Leveraging Spl in the right way is crucial to avoid compromising the design of an application and taking advantage of the most portable php
tags: oop
Mar 11 2010 11:52 PM
vote up
0
vote down

Acceptance Test-Driven Development

I am halfway through reading Growing object-oriented software, guided by tests, a book that teaches Test-Driven Development in a Java environment. A review will come soon, since the process described in this work is really language-agnostic and
tags: phpunit
Mar 10 2010 07:53 PM
vote up
0
vote down

Practical Php Patterns: Observer

This post is part of the Practical Php Pattern series. Today's pattern is the Observer one. The intent of this pattern is breaking a [usually one-to-many] dependency between objects by making the set of objects act as Observers of a Subject one, which
tags: oop
Mar 09 2010 06:12 PM
vote up
0
vote down

How to avoid phase-of-the-Moon bugs

Wikipedia documents some definitions of particularly dangerous bugs, which are very hard to fix and when they manifest constitute a real problem in development. Pay attention to these examples: Heisenbug: bug that changes its behavior when someone is
tags: debugging
Mar 08 2010 06:30 PM
vote up
0
vote down

Last holiday week roundup

This has been a productive week, given that I had finished my exams early in February and I was free from university commitments. Since you follow this blog I thought you would enjoy some focused links to my writings outside of here. I do not want to
tags: php
Mar 06 2010 06:35 PM
vote up
0
vote down

Clever Mock Objects with PHPUnit

PHPUnit is the standard testing framework for php applications, and it has native support for mocking. It can produce various Stubs and Mocks by automatically extending a class or implementing an interface. Expectations can be set on these mocks so that
tags: phpunit
Mar 05 2010 07:18 PM
vote up
0
vote down

Why I'm leaving Subversion for Git

I always believed in Subversion's potential and that it would be a wide improvement over the nightmare that was CVS, but I found out that, as Linus says, There is no way to do CVS right. Subversion is fairly good and it's probably the better centralized
Mar 04 2010 10:20 PM
vote up
0
vote down

Practical Php Patterns: Memento

This post is part of the Practical Php Pattern series. The pattern of today is the Memento one, whose intent is storing the state of an Originator object without breaking its encapsulation, which typically consists in a set of private fields. For the
tags: oop
Mar 03 2010 06:59 PM
vote up
0
vote down

Zend Framework 1.8 Web Application Development review

This is my personal review of Zend Framework 1.8 Web Application Development, a book by Keith Pope (affiliate link). First, a clarification on the book's name, which refers to Zend Framework 1.8: the book work flow is based on the 1.8 version but the Api
tags: review
Mar 02 2010 07:54 PM
vote up
0
vote down

Practical Php Patterns: Mediator

This post is part of the Practical Php Pattern series.   The pattern of the day is the Mediator one. The intent of this pattern is encapsulating the interactions of a set of objects, preventing aggressive coupling from each of them towards the other
tags: oop
Mar 01 2010 06:17 PM
vote up
0
vote down

Some news on my activities

This week has been very satisfactorily so far. First, my talk for phpDay, the most important yearly Italian conference on php, has been accepted. The talk will be in Italian and it takes place on the last day of the conference, May 15th. The title is
tags: off topic
Feb 26 2010 06:25 PM
vote up
0
vote down

Levels of architecture

As I said in a recent post, it is important to have a 50,000 feet view of a software system in our mind before editing even a single line in its codebase. Without a big picture in mind, our changes can push the project in the wrong direction. But there
tags: design
Feb 25 2010 09:20 PM
vote up
0
vote down

3 simple steps to Ubiquitous Language

A customer should be able to view its past orders, along with their dates and chosen products. This is necessary so that clients can view a single piece and request an arbitrary amount of it again.This piece of documentation seems to have been written by
Feb 24 2010 06:01 PM
vote up
0
vote down

The 50000 feet view and Dependency Injection

One criticism of Dependency Injection is the supposed unnecessary abstraction over collaborators that it is imposed by the constructor and setter injection techniques. Writing: class Computer {     public function __construct(Cpu $cpu) {  
tags: oop
Feb 23 2010 06:54 PM
vote up
0
vote down

Practical Php Patterns: Iterator

This post is part of the Practical Php Pattern series.   The behavioral pattern of the day is the Iterator pattern, which provides an abstraction over a very common process: the iteration over a collection of objects [or scalars] located in an
tags: oop
Feb 22 2010 07:58 PM
vote up
0
vote down

1K subscribers

This week the Invisible to the eye feed has surpassed 1024 (1K) subscribers for the first time. :) Thank you all for the support. Your high number encourages me to write more and more.
Feb 21 2010 05:10 PM
vote up
0
vote down

The Number one rule of design

The post on php's foreach construct raised a discussion about the design of the language and of userland code, so I'm recollecting my thoughts here. However, note that I was not discussing the utility of the construct, only the use of array functions
tags: oop
Feb 19 2010 10:24 PM
vote up
0
vote down

Zend Framework 1.8 Web Application Development

I have started reading the book Zend Framework 1.8 Web Application Development, by Keith Pope. From a first impression, it seems a thorough book, which covers testing, authorization, authentication and the various layers of a php application. The review
tags: review
Feb 18 2010 06:22 PM
vote up
0
vote down

Practical Php Patterns: Interpreter

This post is part of the Practical Php Pattern series.   The behavioral pattern of today is the Interpreter pattern, which consists in a representation of a grammar with a Composite class hierarchy, where rules are mapped to classes. An expressio
tags: oop
Feb 18 2010 06:06 PM
vote up
0
vote down

Stop writing foreach() cycles

At least in php. How many for() or foreach() have you written today? I bet a lot. Php 5.3 has a solution that will reduce the average number of iteration structures you need to write: closures applied by plain old array functions. There are some array
tags: php
Feb 17 2010 07:12 PM
vote up
0
vote down

Testing protected members

This is a follow-up to Testing private members. In the previous post, we discussed how to make sure that code in a private method is tested without accessing it directly, since that would imply the use of reflection and a violation of the class contract
tags: oop
Feb 16 2010 10:08 PM
vote up
0
vote down

Repositories in Doctrine

Jebb wrote to me asking information about the Repository pattern: I read your blog at http://giorgiosironi.blogspot.com/and I found it very helpful. I develop applications using DDD and Zend Framework however for persistence ignorance, I use some basic
tags: database
Feb 15 2010 07:05 PM
vote up
0
vote down

Tuning your Ubuntu machine with command line-fu

Ubuntu is in my opinion the leading Linux distribution because of its extended support for peripherals and large software repositories. Though, the default installation profile can be a bit heavy since it is thought as a catch-all configuration for a
Feb 12 2010 06:33 PM
vote up
0
vote down

Practical Php Patterns: Command

This post is the second one in the behavioral patterns part of the Practical Php Pattern series. The behavioral pattern we will discuss today is the Command one, a mechanism for encapsulation of a generic operation. If you are familiar with C or Php, you
tags: oop
Feb 11 2010 07:29 PM
vote up
0
vote down

Testing private members

Yesterday, Sebastian Bergmann, the author of PHPUnit, posted his response to a question he is asked frequently, How do I test private members of a class? He summarizes the ways to access private fields and methods of an object from a PHPUnit test case,
tags: oop
Feb 10 2010 08:15 PM
vote up
0
vote down

Practical Php Patterns: Chain of Responsibility

This post starts the behavioral patterns part of the Practical Php Pattern series. The first behavioral pattern of this part of the series is named Chain of Responsibility. Its intent is organizing a chain of objects to handle a request such as a method
tags: oop
Feb 09 2010 04:44 PM
vote up
0
vote down

Practical Php Patterns: Structural patterns summary

This post is part of the Practical Php Pattern series. The GoF book says there is a lot of similarity between structural patterns because of the few kinds of relationships in object model structures: inheritance and implementation between classes plus
tags: oop
Feb 08 2010 07:41 PM
vote up
0
vote down

Test suites and php namespaces

Php namespaces, introduced with the 5.3 release, are a great tool to stop writing very long class names. Importing class names via use statements makes you able to refer to classes via their base name, for example by writing: use
tags: php
Feb 07 2010 06:53 PM
vote up
0
vote down

Automated refactoring without heavy IDEs

Unix programs are beautiful and universally compatible. You can chain them to accomplish incredible tasks. Let's do some automated refactoring such as renaming php classes and methods without IDEs, using only sed, find and grep, plus your version control
Feb 05 2010 07:07 PM
vote up
0
vote down

Practical Php Patterns: Proxy

This post is part of the Practical Php Pattern series.   The structural pattern of today is the Proxy pattern, an enhancement on the simple handler (or pointer) used as a reference to an object: this pointer is substituted by a Proxy object which
tags: oop
Feb 04 2010 08:57 PM
vote up
0
vote down

Where is business logic?

Have you ever heard of Multitier architecture? If not, you have probably encountered it without knowing its name while working on web applications. In a multitier architecture, an application is divided in different horizontal layers, each addressing a
tags: database
Feb 03 2010 06:53 PM
vote up
0
vote down

Practical Php Patterns: Flyweight

This post is part of the Practical Php Pattern series. The structural pattern of the day is the Flyweight one, which is a technique for the creation of stateful objects used as shared instances. The pillars of the Flyweight pattern are the following:
tags: php
Feb 02 2010 05:50 PM
vote up
0
vote down

Velocity

There's an old joke that goes like this: One day a pilgrim was walking towards Santiago and, during the way, he encountered a philosopher. He asked the supposedly wise man: "How much does it take to arrive to Santiago?" But the philosopher did not
Feb 01 2010 09:25 PM
vote up
1
vote down

Practical Php Patterns: Facade

This post is part of the Practical Php Pattern series. The structural pattern of today is the Facade one. A Facade is a class that provides a unified interface to a subsystem, totally abstracting away the concrete classes which compose it. The Client is
tags: oop
Jan 29 2010 10:38 PM
vote up
0
vote down

Writing a Facebook application

Facebook is the largest social network in the world (300 million users) and it is surely a showcase for web applications. You can easily write a self-hosted application that interacts with the Facebook Api, obtaining access to the user details and
Jan 28 2010 07:46 PM
vote up
0
vote down

Practical Php Patterns: Decorator

This post is part of the Practical Php Pattern series. Today we will explore the Decorator pattern, an alternative to subclassing which favors object composition over class inheritance. A common issue of subclassing is its rigidity: when different
tags: oop
Jan 25 2010 07:04 PM
vote up
0
vote down

Teachers and the value of formal education

Question: is it clever to drive for half an hour and drive back another half hour to listen to a 90 minutes lecture? If the teacher is worth it, yes. At Politecnico di Milano I found out that very often the professors are not in their position because of
Jan 22 2010 07:51 PM
vote up
0
vote down

Practical Php Patterns: Composite

This post is part of the Practical Php Pattern series. One of the most important structural patterns is the Composite one: its goal is managing a hierarchy of objects where both leaf objects and composition of other objects conform to a common interface.
tags: oop
Jan 20 2010 09:38 PM
vote up
0
vote down

Relationships between objects

This article implements the beginner pattern, but it can also be useful to recap the terms we use lightheartedly in discussions about object-oriented programming. In the definitions, we will talk about a relationship between a Source and Target objects,
tags: oop
Jan 19 2010 08:10 PM
vote up
0
vote down

Practical Php Patterns: Bridge

This post is part of the Practical Php Pattern series. Today we will explore the Bridge pattern, whose intent is separating an abstraction from its implementation to improve decoupling and allowing them both to change independently. Commonly an
tags: oop
Jan 18 2010 10:40 PM