News Feed
Sections




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

XpertDeveloper.com:
Abstract in PHP
October 28, 2011 @ 09:55:07

On the XpertDeveloper.com site today there's a new tutorial talking about something that can not only help the structure of your application but can make things more reusable in the end - abstract classes.

For Abstact keyword we can say that, abstract is type of the class and class which we can't create a object of it. Surprised???? [...] Abstract class can be used some what like an interface in PHP. So basically we can implement class using abstract. We can't extend more than one abstract class while we can implement more than one interface.

They introduce you to the creation of an abstract class and show how to set up some abstract methods inside. These methods are required to be defined as a part of the extension in your class. One of the benefits they don't mention of abstract classes over interfaces is the ability to have methods in the abstract that are actual code, not just definitions of the structure (that's more of what interfaces are for).

1 comment voice your opinion now!
abstract class structure interface code


blog comments powered by Disqus

Similar Posts

DevShed: Decoupling the Validation of Data with Bridge Classes in PHP 5

Project: RIPS - Static Source Code Analyzer for Vulnerabilities in PHP Scripts

PHPMaster.com: Documentation Makes the World Go Round

PHP -GTK Community Site: A New Trio of Posts (phpISO, a PHP-GTK book, and Dev Inspector)

DevShed: Processing File Data with Template Classes in PHP 5


Community Events





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


bugfix code library configure introduction application developer laravel api wordpress series framework community podcast interview project language threedevsandamaybe release list

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