Skip to main content
Corrected Spoon link
Source Link
dusan
  • 105
  • 4

Java-bean syntax due to lack of C# properties

/** * Name of user */ private String name; /** * Gets name of user * @return Name of user */ public String getName() { return this.name; } /** * Sets name of user. * @param name */ public void setName(final String name) { this.name = name; } 

GAH!!!

Issues I have with this

  • Too much code - Have a field that's documented, a getter method that's documented, and a setter method that's documented. This extremely basic example has 20 lines of code for a single property
  • Clutters method lists - "Let me find that method, hand on: getX, getY, getZ, getAnotherAnnoyingField, getWhyIHateJavaBeans, getThisIsVerbose, getGAH... ah there it is, hashCode.
  • Multiple area's of documentation lead to poor, outdated, or missing documentation - Annoying when trying to understand what code does
  • So annoying a 3rd party had to come up with a plugin to do this easily - SpoonSpoon, Shark, among others.

Java-bean syntax due to lack of C# properties

/** * Name of user */ private String name; /** * Gets name of user * @return Name of user */ public String getName() { return this.name; } /** * Sets name of user. * @param name */ public void setName(final String name) { this.name = name; } 

GAH!!!

Issues I have with this

  • Too much code - Have a field that's documented, a getter method that's documented, and a setter method that's documented. This extremely basic example has 20 lines of code for a single property
  • Clutters method lists - "Let me find that method, hand on: getX, getY, getZ, getAnotherAnnoyingField, getWhyIHateJavaBeans, getThisIsVerbose, getGAH... ah there it is, hashCode.
  • Multiple area's of documentation lead to poor, outdated, or missing documentation - Annoying when trying to understand what code does
  • So annoying a 3rd party had to come up with a plugin to do this easily - Spoon, Shark, among others.

Java-bean syntax due to lack of C# properties

/** * Name of user */ private String name; /** * Gets name of user * @return Name of user */ public String getName() { return this.name; } /** * Sets name of user. * @param name */ public void setName(final String name) { this.name = name; } 

GAH!!!

Issues I have with this

  • Too much code - Have a field that's documented, a getter method that's documented, and a setter method that's documented. This extremely basic example has 20 lines of code for a single property
  • Clutters method lists - "Let me find that method, hand on: getX, getY, getZ, getAnotherAnnoyingField, getWhyIHateJavaBeans, getThisIsVerbose, getGAH... ah there it is, hashCode.
  • Multiple area's of documentation lead to poor, outdated, or missing documentation - Annoying when trying to understand what code does
  • So annoying a 3rd party had to come up with a plugin to do this easily - Spoon, Shark, among others.
Post Made Community Wiki
Source Link
TheLQ
  • 13.7k
  • 7
  • 57
  • 88

Java-bean syntax due to lack of C# properties

/** * Name of user */ private String name; /** * Gets name of user * @return Name of user */ public String getName() { return this.name; } /** * Sets name of user. * @param name */ public void setName(final String name) { this.name = name; } 

GAH!!!

Issues I have with this

  • Too much code - Have a field that's documented, a getter method that's documented, and a setter method that's documented. This extremely basic example has 20 lines of code for a single property
  • Clutters method lists - "Let me find that method, hand on: getX, getY, getZ, getAnotherAnnoyingField, getWhyIHateJavaBeans, getThisIsVerbose, getGAH... ah there it is, hashCode.
  • Multiple area's of documentation lead to poor, outdated, or missing documentation - Annoying when trying to understand what code does
  • So annoying a 3rd party had to come up with a plugin to do this easily - Spoon, Shark, among others.