note 103752 added to language.oop5.abstract
| From: | AdrianN at osu1 dot php dot net | Date: | Mon, 02 May 2011 11:10:53 +0000 |
| Subject: | note 103752 added to language.oop5.abstract | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-179332@lists.php.net to get a copy of this message | ||
By their nature, although sometimes they may look quite similar, abstract classes and class
interfaces serve very distinct purposes.
The interface of a class is meant as a tool for the "user" of that class. An interface is
a public presentation for the class, and it should advertise, to anyone considering to use it, what
methods and constants are available and accessible from the outside. So, as it name suggests, it
always sits between the user and the class implementing it.
On the other hand, an abstract class is a tool aimed at helping the "implementor" of the
classes that extend it. It is an infrastructure that can impose restrictions and guidelines about
what the concrete classes should look like. From a class design perspective, abstract classes are
more architecturally important than interfaces. In this case, the implementor sits between the
abstract class and the concrete one, building the latter on top of the former.
----
Server IP: 69.147.83.197
Probable Submitter: 212.227.35.137
----
Manual Page -- http://www.php.net/manual/en/language.oop5.abstract.php
Edit -- https://master.php.net/note/edit/103752
Del: integrated -- https://master.php.net/note/delete/103752/integrated
Del: useless -- https://master.php.net/note/delete/103752/useless
Del: bad code -- https://master.php.net/note/delete/103752/bad+code
Del: spam -- https://master.php.net/note/delete/103752/spam
Del: non-english -- https://master.php.net/note/delete/103752/non-english
Del: in docs -- https://master.php.net/note/delete/103752/in+docs
Del: other reasons-- https://master.php.net/note/delete/103752
Reject -- https://master.php.net/note/reject/103752
Search -- https://master.php.net/manage/user-notes.php