Content deleted Content added
m Reverted 1 edit by 209.68.90.121 (talk) to last revision by 2405:204:541B:AFB6:E2A4:3042:9DD0:323A (TW) |
Bluelinking 1 books for verifiability.) #IABot (v2.1alpha3 |
||
Line 31:
== Disadvantages ==
* A class with a [[nullary constructor|zero-argument constructor]] is subject to being instantiated in an invalid state.<ref name="Bloch">{{cite book|last1=Bloch|first1=Joshua|authorlink1=Joshua Bloch|title=Effective Java|date=2008|publisher=Addison-Wesley|isbn=978-0-321-35668-0|page=[https://archive.org/details/effectivejava00bloc_0/page/13 13]|edition=Second|url-access=registration|url=https://archive.org/details/effectivejava00bloc_0/page/13}}</ref> If such a class is instantiated manually by a developer (rather than automatically by some kind of framework), the developer might not realize that the class has been improperly instantiated. The compiler cannot detect such a problem, and even if it is documented, there is no guarantee that the developer will see the documentation.
* JavaBeans are inherently mutable and so lack the advantages offered by [[immutable objects]].<ref name="Bloch"/>
* Having to create getters for every property and setters for many, most, or all of them can lead to an immense quantity of [[boilerplate code]].
|