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

Zend Developer Zone:
Liskov Substitution Principle...attempted
June 07, 2011 @ 11:09:41

In a previous post to the Zend Developer Zone Keith Casey talked about the SOLID principles of software development, a set of guidelines that can help to make software more maintainable and easier to work with. In this new post he looks at the "L" in SOLID, the Liskov Substitution Principle.

So the Liskov Substitution Principle boils down to: method/class preconditions cannot be strengthened, method/class post conditions can't be weakened, all exceptions thrown must equally interchangeable and method signatures should be completely compatible.

To help make this all a bit clearer, he includes some code showing a basic class (Rectangle) and how difficult it can be to try to appease all of the principles above without the "fix one, break another" scenario. On comment to the post suggests something that might help things a bit - programming by contract.

0 comments voice your opinion now!
solid software development liskov substitution principle


blog comments powered by Disqus

Similar Posts

VentureBeat.com: Exclusive: Facebook opens up about open-source software

Felix Geisendörfer's Blog: Agile Web development (with CakePHP)

Danne Lundqvist's Blog: Setting up a development environment with apache-2.2.6

Chris Justus' Blog: 4 Reasons Java Will Outlive PHP (My interview with IEEE...)

NetTuts.com: SOLID: Part 1 - The Single Responsibility Principle


Community Events











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


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

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