|
|
|
|
|
by wtracy
2613 days ago
|
|
In the original JavaBeans spec, getters and setters served two purposes: 1. By declaring a getter without a setter, you could make a field read-only. 2. A setter could trigger other side effects. Specifically, the JavaBeans spec allowed for an arbitrary number of listeners to register callbacks that trigger whenever a value gets changed. Of course, nobody actually understood or correctly implemented all this, and it all got cargo culted to hell. |
|