direct access to swt classes' fields [message #504794] |
Tue, 22 December 2009 12:24  |
Eclipse User |
|
|
|
Hi,
maybe this is a really trivial question, but I don't understand why most classes of SWT (e.g., Point, Rectangular, PaintEvent,...) provide direct access to their members instead of using getters. While both using getters and direct access provide the same result, making a field public means there will be no way to change the way it is accessed. What is the design choice that lead this?
|
|
|
Re: direct access to swt classes' fields [message #504815 is a reply to message #504794] |
Tue, 22 December 2009 14:06  |
Eclipse User |
|
|
|
Hi,
Though this might not be an authorotive answer here's my interpreation:
* Point, Rectangular are more like structs to pass a round multiple
values
* SWT tries to be as small as possible so there's no overhead needed
for such often access fields which might not be a problem in
Desktop-Envs but think of a paint event access in a embedded device.
Tom
Am 22.12.09 18:24, schrieb Luca Ferrari:
> Hi,
> maybe this is a really trivial question, but I don't understand why most
> classes of SWT (e.g., Point, Rectangular, PaintEvent,...) provide direct
> access to their members instead of using getters. While both using
> getters and direct access provide the same result, making a field public
> means there will be no way to change the way it is accessed. What is the
> design choice that lead this?
|
|
|
Powered by
FUDForum. Page generated in 0.04920 seconds