Title: AW: [qooxdoo-devel] Suggestion: Chaining setters

Hi Sebastian,

I know that it's more or less syntactic sugar but I don't see the negative effects. Setters already do return values. They return the new value of the property but I don't know if anyone uses it to returning this would be more reasonable.

Best Fabian

-----Ursprüngliche Nachricht-----
Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Im Auftrag von Sebastian Werner

Gesendet: Freitag, 8. September 2006 12:14
An: qooxdoo Development
Betreff: Re: [qooxdoo-devel] Suggestion: Chaining setters

Hi!

If I remember correctly this was already discussed previously on this
list. It has to many negative effects. Generally this means it's not
anymore possible to return null or just make it undefined. Also it's
maybe a performance impact to always return a value where currently
there is no return at all.

I think the alternative shown by Alex is easy enough:

object.set({ foo : 20, bar : 100 });

-1 ;)

Sebastian


Fabian Jakobs schrieb:
> Hi,
>

>
> Since the property system is about to be rewritten in a future release I
> would like to make a feature request for this.
>
> Currently setters do return the new value of the property. I would like
> to have setters return the current object. This way it is possible to
> chain setters.
>

>
> Right now we have to write code like this:
>

>
>        var fs = new qx.ui.groupbox.GroupBox("My first Fieldset");
>

>
>       with(fs)
>
>       {
>
>         setWidth("40%");
>
>         setBottom(48);
>
>         setTop(48);
>
>         setLeft(20);
>

>
>         setMaxWidth(350);
>
>         setMinWidth(250);
>
>       };
>

>

>
> With the new approach this code could be written like this:
>

>
>      fs.
>
> setWidth("40%").
>
> setBottom(48).
>
>             setTop(48).
>
>             setLeft(20).
>
> setMaxWidth(350).
>
> setMinWidth(250);
>

>

>
> Or just like this:
>

>
>     
> fs.setWidth("40%").setBottom(48).setTop(48).setLeft(20).setMaxWidth(350).setMinWidth(250);
>

>

>
> I don't know if this change would brake current code so I suggest it for
> the upcoming 0.7 release.
>

>
> Best Fabian
>

>

>
> BTW congrats to the 0.6 release!!
>

>
>
> ------------------------------------------------------------------------
>
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> qooxdoo-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to