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

QaFoo Blog:
Abstract Classes vs. Interfaces
October 02, 2012 @ 12:29:56

On the QaFoo.com blog Kore Nordmann shares some insight about the difference between abstract classes and interfaces and how they can be used effectively/correctly.

Features of object oriented languages are often use from a purely technical perspective, without respect to their actual semantics. This is fine as long as it works for you, but might lead to problems in the long run. In this article I discuss the semantical differences between abstract classes and interfaces. I also outline why following the semantics of those language constructs can lead to better code.

He defines "class" and "interface" before he gets too far into the differences, stating that a "class" is more of a "type" while an "interface" describes the type and the structure to use it. He also talks about how to tell them apart (when to use each). There's also some examples and "hints" to help you determine good and bad examples of interfaces and when an abstract class might be a better answer.

0 comments voice your opinion now!
abstract class interface compare tips definition


blog comments powered by Disqus

Similar Posts

Jeremy Cook's Blog: Using the Countable Interface

DevShed: Polymorphism, Design Patterns, and PHP Programming

Stubbles Blog: My wishlist for PHP 6, pt1: The 'object' type hint

DevShed: Building a Data Validation System with the Prototype Pattern with PHP 5

IBM developerWorks: What's new in PHP V5.3, Part 1: Changes to the object interface


Community Events











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


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

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