refactoring

  • submit to reddit

Practical PHP Refactoring: Duplicate Observed Data

In the scenario of today, we have informations of some kind which are present in the view (script, variables, presentational objects, JSON) but not in the...

0 replies - 3870 views - 08/29/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 - 5525 views - 08/24/11 by Giorgio Sironi in Articles

Practical PHP Refactoring: Change Reference to Value

This refactoring targets simplification: it is the opposite of Change Value to Reference. An object whose lifecycle is tracked and which must have a single...

0 replies - 4194 views - 08/22/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 - 4366 views - 08/17/11 by Giorgio Sironi in Articles

Practical PHP Refactoring: Replace Data Value with Object

One of the rules of simple design is the necessity to minimize the number of moving parts, like classes and methods, as long as the tests are satisfied and we...

0 replies - 4123 views - 08/15/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 - 3887 views - 08/10/11 by Giorgio Sironi in Articles

Practical PHP Refactoring: Inline Class

Every refactoring technique is potentially bidirectional: their list is a toolbox, and you decide when to use each tool.Inline Class is the inverse of Extract...

0 replies - 4602 views - 07/28/11 by Giorgio Sironi in Articles

Practical PHP Refactoring: Extract Class

Sometimes there is too much logic to deal with in a single class. You tried extracting methods, but they are so many that the design is still complex to...

0 replies - 4845 views - 07/20/11 by Giorgio Sironi in Articles

Practical PHP Refactoring: Move Field

Object-oriented programming is based on the encapsulation of state and behavior associated with that state in decoupled items called objects. In the previous...

0 replies - 4014 views - 07/18/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 - 4768 views - 07/12/11 by Giorgio Sironi in Articles

Extract Part Of Class In Ruby Into Separate Class

0 replies - 1597 views - 03/15/11 by Alexey Tarasevich in Uncategorized

Eliminating duplication

The title of this article is Eliminating duplication, and when you read that I think you will have guessed I would be talking about code. Of course I will...

0 replies - 3439 views - 03/10/11 by Giorgio Sironi in Articles

Destroy C Code Which Is Not In #ifdef Symbol

0 replies - 1871 views - 12/01/10 by Snippets Manager in Uncategorized

Primitive Obsession

The Primitive Obsession is an anti-pattern well diffused in many different programming languages, especially in the ones supporting object-oriented...

2 replies - 4552 views - 10/28/10 by Giorgio Sironi in Articles

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 - 17186 views - 09/30/10 by Giorgio Sironi in Articles