Properties instead of Java-style getters and setters?
    Frank Benoit 
    keinfarbton at googlemail.com
       
    Wed Sep  3 15:38:52 PDT 2008
    
    
  
Robin Kreis schrieb:
> I've been looking for a fine GUI toolkit for a while now, and from what
> I've seen, DWT looks really fine.
> 
> What I'm concerned with is DWT carrying over some of the limitations of
> Java.  While I do like Java and also SWT, I dislike the idea to make
> certain decisions just because the people behind SWT had no other
> options.
> 
> Although DWT appears to fit into D quite well, I'd love to see real D
> properties replace getters and setters, or at least alias them.  Those
> only exist in SWT because Java has no other property support. Getters
> and setters are treated like properties in Java, for example in GUI
> builders, refactoring tools or scripting languages like Jython.
> 
I do not like the D properties. I also do not like operator overloading.
I think it is much more important to see what is going on. If it looks
like a field, it should be a field. But that is a matter of personal
taste. :)
What priority do others give to this?
A problem could be, that the identifier for the property can conflict to
private methods and fields.
If the field is renamed to solve that conflict a later upgrade merge can
introcude hard to find errors.
Can D2 add properties with "unified function call syntax" ? (does this
feature already exist?)
If so, i think, those properties could be added in a clean way. Because
they only act on the public API.
    
    
More information about the Digitalmars-d-dwt
mailing list