OOP ( ). PHP - script , .
, OOP, Java, Bruce Ekcel - Thinking in Java ( Amazon , : http://www.mindviewinc.com/Books/downloads.html). , PHP. , PHP. PHP, Java ( , , Java , PHP).
, , . " API" " " (. "" ), " " " ".
, .
, : : /, , , . , , 2 , , , . setState() getState(), ($ this- > state = $param; $this- > ), , -write , , (, ).
There are several more or less deep similar topics in OOP, this getter / setter is probably the most important of the main ones.
So my tips are:
- use OOP, this is your friend;
- use PHP in the same way as JAVA (strict OOP language), and not as in FORTRAN.
source
share