Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[golo-dev] Property-style method on computed fields

Hello guys,

The PR about the property-style method[1] is almost done. The last point of discussion is about 
computed fields.

Given the following class
class Person {
  private Date birthday;

  public Date getBirthday() { return birthday; }

  public int getAge() { ... }
}

The person's age is a computed fields accessible via a getter. When we talk about class "properties", should we include the field age or not. Should we strictly follow the JavaBean convention (we check a field foo exists before invoking the associate getFoo)?

In a nutshell: Should we include computed fields in this PR or not?

Feel free to comment the PR ;)
  
[1] https://github.com/eclipse/golo-lang/pull/332


Back to the top