CHJani / google-api-java-client

Automatically exported from code.google.com/p/google-api-java-client
0 stars 0 forks source link

Do not have any direct field accessors #343

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Filed internally by yanivi:

To access collections we are currently using a public final field.  For 
example, generated Buzz has this:

 public final Activities activities = new Activities();

This is exposing an implementation detail.  For example, we might consider 
instead to create a new instance of Activities every time it is used.  By 
hiding it behind an accessor method, we would have that flexibilty:

public Activities activities() {
 return activities;
}

This also follows our general Java style guide of not having any direct field 
accessors.

Original issue reported on code.google.com by rmis...@google.com on 4 Nov 2011 at 3:41

GoogleCodeExporter commented 9 years ago

Original comment by rmis...@google.com on 4 Nov 2011 at 3:42