News Feed
Jobs Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Sameer Borate's Blog:
Refactoring 2 Extract Method
January 12, 2009 @ 20:18:35

Sameer has posted the second part of his series looking at refactoring with a spotlight on the Extract method.

The 'Extract Method' is one of the most common refactorings you will ever do. It is also one you will frequently see implemented on the Refactor tool menu on various IDE's. What this method basically does is to take a group of related code and convert it to a function with a appropriate name that easily explains the purpose of the code.

He gives a code example - converting hotel room price to points based on the currency its requested in - both with and without the Extract method in use.

0 comments voice your opinion now!
refactor extract method example convert hotel price points


blog comments powered by Disqus

Similar Posts

PHPit.net: Having fun with PHP\'s output buffer

Web Developer Juice: PHP Magic Functions: Best Part of Object Oriented PHP - Part 1

Maarten Balliauw's Blog: Reuse Excel business logic with PHPExcel

NETTUTS.com: Create a PHP5 Framework - Part 2

Zend Developer Zone: Improved Test Assets for Zend_Tool Generated Projects in ZF 1.11.4


Community Events











Don't see your event here?
Let us know!


facebook application hhvm framework unittest package introduction podcast language symfony2 hack install opinion composer series component security code release overview

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework