oop

  • submit to reddit

Practical PHP Refactoring: Change Bidirectional Association to Unidirectional

This refactoring is the inverse of Change Unidirectional Association to Bidirectional. We start from a bidirectional association, where two objects reference...

0 replies - 4268 views - 09/05/11 by Giorgio Sironi in Articles

Practical PHP Refactoring: Change Unidirectional Association to Bidirectional

Object graphs are built by maintaining references to other objects inside an object's fields (usually private). These associations are persisted and stored by...

0 replies - 4469 views - 08/31/11 by Giorgio Sironi in Articles

Practical PHP Refactoring: Replace Array with Object

This refactoring is a specialization of Replace Data Value with Object: its goal is to replace a scalar or primitive structure (in this case, an ever-present...

0 replies - 5605 views - 08/24/11 by Giorgio Sironi in Articles

Object Calisthenics

Calisthenics is a Greek-derived term for exercises, in the gym sense. I have object calisthenics, exercises for object-oriented programming, around for a long...

3 replies - 6032 views - 08/18/11 by Giorgio Sironi in Articles

Practical PHP Refactoring: Change Value to Reference

Classes derived from data have often multiple copies of equal objects lying around: there is no functional difference between them. Examples of these classes...

0 replies - 4421 views - 08/17/11 by Giorgio Sironi in Articles

Practical PHP Refactoring: Self Encapsulate Field

We are entering the data organization refactorings section of Fowler's book: these methods apply to object which maintain state, like entities, records, value...

0 replies - 3950 views - 08/10/11 by Giorgio Sironi in Articles

Practical PHP Refactoring: Move Method

Following in Fowler's steps, we start a section of refactorings that involve moving features and code between classes and objects. While the changes we have...

0 replies - 4818 views - 07/12/11 by Giorgio Sironi in Articles

Classical inheritance in JavaScript

If you have written a bit of JavaScript, you certainly have heard the word prototype. Prototype is not only a JavaScript library, but also a key concept of...

0 replies - 5604 views - 05/03/11 by Giorgio Sironi in Articles

The Gang of Four patterns as everyday objects

A System Metaphor is what eXtreme Programming use to describe an architecture: for example you can think of particular application as production lines, or...

7 replies - 15247 views - 04/27/11 by Giorgio Sironi in Articles

SOLID for packag... err, namespaces

The SOLID principles are a set of guidelines that drives good object-oriented design. They were defined from different people along the years, like Bertrand...

0 replies - 6039 views - 03/01/11 by Giorgio Sironi in Articles

Why Ruby's monkey patching is better than land mines...wait, what?

In the last days, the article Why PHP is better than Ruby has got very popular on DZone. Unfortunately, the majority of popular articles are very...

5 replies - 6932 views - 02/24/11 by Giorgio Sironi in Articles

Double Dispatch: the next best thing with respect to Dependency Injection

Object-oriented languages, like C++, Java and PHP, implement what is called single dispatch: when you have an object in a variable and you call a method on...

0 replies - 7119 views - 12/07/10 by Giorgio Sironi in Articles

PHP5 __sleep To Handle Superclasses' Private Members

0 replies - 1651 views - 11/16/10 by Snippets Manager in Uncategorized

What we don't need in object-oriented programming

Once I heard Alberto Brandolini giving a keynote at an Italian conference, saying, between other insights, that Lego bricks where one of the most abused...

34 replies - 17317 views - 09/30/10 by Giorgio Sironi in Articles

Evolution of a programmer

As a software developer, it's common to learn new practices every day. Although there are jokes about how the more a programmer ages, the more his lines of...

4 replies - 21352 views - 05/04/10 by Giorgio Sironi in Articles