W3C home > Mailing lists > Public > www-dom@w3.org > October to December 1999

Re: DOM Range comments

From: <keshlam@us.ibm.com>
Date: Tue, 28 Dec 1999 21:05:10 -0500
cc: www-dom@w3.org
Message-ID: <85256856.000B51AE.00@D51MTA03.pok.ibm.com>
>Why the Java binding is getIsCollapsed() ?

Interesting point.

The standard Java (or, more accurately, Java Beans) design pattern is that
getters for boolean properties have names which follow one of two patterns,
either getWhatever() -- as for any other property -- or isWhatever().  If
the attribute's name is isCollapsed, then getIsCollapsed() may be confusing
but does follow Java's conventions.

isIsCollapsed() would be even more confusing, of course, but would still be
formally "correct".

I'm not delighted by the idea of making this a special-case in the
conversion from abstract design to specific language bindings; I like the
consistancy we've maintained so far. But it might be worth considering
changing the property name from isCollapsed to simply collapsed. That would
undo this minor cognative clash, and I don't think it would adversely
impact comprehensibility of code.



______________________________________
Joe Kesselman  / IBM Research
Received on Tuesday, 28 December 1999 21:03:57 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:13:47 GMT