News Feed
Sections




News Archive
feed this:

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

NetTuts.com:
How to Write Testable and Maintainable Code in PHP
May 16, 2013 @ 11:53:18

NetTuts.com has a new tutorial posted suggesting a few ways you can make testable and maintainable code in PHP applications.

Frameworks provide a tool for rapid application development, but often accrue technical debt as rapidly as they allow you to create functionality. Technical debt is created when maintainability isn't a purposeful focus of the developer. Future changes and debugging become costly, due to a lack of unit testing and structure. Here's how to begin structuring your code to achieve testability and maintainability - and save you time.

There's a few concepts they cover in the tutorial including DRY (don't repeat yourself), working with dependency injection and actually writing the tests with PHPUnit. They start with a bit of code that needs some work and use the tests to help refactor it into something that can be easily mocked (using Mockery).

0 comments voice your opinion now!
testable maintainable code tutorial bestpractice mock object

Link: http://net.tutsplus.com/tutorials/php/how-to-write-testable-and-maintainable-code-in-php

PHPBuilder.com:
PHP Dependency Injection Creates More Maintainable Code
May 02, 2011 @ 09:52:05

On PHPBuilder.com Jason Gilmore has posted a new article looking at the benefits of dependency injection in helping you keep your code more maintainable and well-structured.

Of course, the advantages of object-orientation can only be fully exploited when implemented in conjunction with best practices such as encapsulation and inheritance. One such "implementational" best practice is dependency injection, a design pattern that facilitates the decoupling of otherwise dependent components. [...] Save yourself the trouble and decouple components using dependency injection.

He gives an example of how a simple dependency injection (DI) method on an "Account" class to take the database connection dependency out of the actual class and into an encapsulated object. This way, any sort of standardized database object can be passed in and acted upon. He also mentions two dependency injection containers you could use to help you implement it - Symfony's and Pimple.

0 comments voice your opinion now!
maintainable code dependency injection tutorial


M
April 06, 2007 @ 07:10:43

Company Maintainable Software
Location Telecommute
Title PHP Developer
Summary

Qualifications:

  • Strong understanding of XHTML, CSS, and standards-based design
  • Object Oriented Programming experience and familiarity with testing
  • Knowledge of key differences between PHP 4 and 5
  • Some experience with XML and web services
  • Familiarity with MySQL and be able to write SQL queries
  • Understanding of source control including branching and tagging
  • Working knowledge of the UNIX shell and configuring Apache with PHP
  • Strong work ethnic, be a team player, and have excellent reference

Link More Information
1 comment voice your opinion now!
job post maintainable software telecommute developer job post maintainable software telecommute developer


Laura Thomson's Blog:
NYPHP Conference 2006 ("Writing Maintainable Code")
May 26, 2006 @ 05:58:54

Laura Thomson has a brief mention on her blog today about the talk she'll be giivng at this year's New York PHP Conference concerning "Writing Maintainable Code".

I think of it as an anti-The-Daily-WTF talk, and it should be more entertaining than it perhaps sounds. (If you've never read the WTF, I strongly recommend it both for entertainment and enlightenment.) I believe in terse, elegant code that gets the job done, which perhaps reflects my origins as a C programmer rather than as a Java one.

You can get complete details on her talk and on the conference from the official New York PHP Conference website, including saving your place at the conference by registering.

0 comments voice your opinion now!
nyew york conference talk laura thomson maintainable nyew york conference talk laura thomson maintainable



Community Events





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


release tool community composer security introduction update application podcast package interview symfony laravel version voicesoftheelephpant opinion library framework language series

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