piccolo2d / piccolo2d.java

Structured 2D Graphics Framework
http://piccolo2d.org
Other
51 stars 14 forks source link

Property names don't match JavaBean conventions #157

Closed mro closed 10 months ago

mro commented 9 years ago

Originally reported on Google Code with ID 157

Most boolean properties have accessors that don't follow the JavaBeans 
naming convention.  Boolean accessors should have a "is" prefix.

For example, to determine if a PNode is visible, "getVisible" is provided, 
but it should be "isVisible".

Reported by allain.lalonde on 2010-01-24 14:42:28

mro commented 9 years ago
+1 from me for inclusion into 1.3.1

Reported by heuermh on 2010-12-14 03:10:21

mro commented 9 years ago
Fixing this breaks the api.

Reported by allain.lalonde on 2010-12-14 03:16:44

mro commented 9 years ago
well, not if getVisible is still there

Reported by heuermh on 2010-12-14 04:06:48

mro commented 9 years ago
would we update calls to getVisible to invoke isVisible instead? if so, this is an api
break b/c clients may be overridding getVisible()...

http://wiki.eclipse.org/Evolving_Java-based_APIs#Example_4_-_Adding_an_API_method

Reported by atdixon on 2010-12-15 02:41:01

mro commented 9 years ago
Very true.  Thanks, guys.

Most often in my own code all classes are final, or methods that are meant to be overridden
are abstract and those not are final.  There is a Checkstyle warning to this effect.
 In Piccolo2D almost everything is overrideable, for better or worse.

Allain, want to move this to Milestone-2.0 then?

Reported by heuermh on 2010-12-15 04:23:35

mro commented 9 years ago

Reported by heuermh on 2013-11-26 23:23:21