note 102676 added to language.oop5.interfaces
[email protected] Mon, 28 Feb 2011 06:07:02 -0800
| Newsgroups | php.notes |
|---|---|
| Message-ID | <[email protected]> |
@jballard at natoga dot com, actually, programming interfaces are very much like computer peripheral interfaces. Hence the reason they are called interfaces. I agree that you wouldn't use an object interface in the sense of OO programming to connect to a peripheral, but to say that they are not at all alike is incorrect. In fact they use the exact same concept. To clarify for others who may be confused, object interfaces are used to define the methods an object MUST have for the purposes of interfacing to another object. Generally an object interface is used when another class will most definitely call the methods defined by the interface. In this example, if the implementing object did not implement the interface (and for aguments sake php did not throw an error) then the software wouldn't work together. Peripheral interfaces define a set of functions which are normally the functions the peripheral can/will perform. In certain circumstances a peripheral may require the software to perform a certain function(s) to operate correctly. This is the essence of an interface. It defines how two things work together to do something. Both software and peripheral interfaces operate within this definition. ---- Server IP: 69.147.83.197 Probable Submitter: 124.178.45.73 ---- Manual Page -- http://www.php.net/manual/en/language.oop5.interfaces.php Edit -- https://master.php.net/note/edit/102676 Del: integrated -- https://master.php.net/note/delete/102676/integrated Del: useless -- https://master.php.net/note/delete/102676/useless Del: bad code -- https://master.php.net/note/delete/102676/bad+code Del: spam -- https://master.php.net/note/delete/102676/spam Del: non-english -- https://master.php.net/note/delete/102676/non-english Del: in docs -- https://master.php.net/note/delete/102676/in+docs Del: other reasons-- https://master.php.net/note/delete/102676 Reject -- https://master.php.net/note/reject/102676 Search -- https://master.php.net/manage/user-notes.php