Discussion:
[platform-swt-dev] Looking for additional reviewers - builder classes for SWT
Eric Williams
2018-10-23 07:40:34 UTC
Permalink
Hello everyone,

We have a patch in gerrit to add support for builder/factory classes
into SWT: https://git.eclipse.org/r/#/c/131348/

Please take a look if you have a moment!
--
Eric Williams
Software Engineer - Eclipse/SWT Team
Red Hat
Lars Vogel
2018-10-23 07:44:57 UTC
Permalink
Hi Eric,

I will have a look, I did create custom builder classes in several
customer projects and would love to see builder support in SWT.

Best regards, Lars
Post by Eric Williams
Hello everyone,
We have a patch in gerrit to add support for builder/factory classes
into SWT: https://git.eclipse.org/r/#/c/131348/
Please take a look if you have a moment!
--
Eric Williams
Software Engineer - Eclipse/SWT Team
Red Hat
_______________________________________________
platform-swt-dev mailing list
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/platform-swt-dev
--
Eclipse Platform project co-lead
CEO vogella GmbH

Haindaalwisch 17a, 22395 Hamburg
Amtsgericht Hamburg: HRB 127058
Geschäftsführer: Lars Vogel, Jennifer Nerlich de Vogel
USt-IdNr.: DE284122352
Fax (040) 5247 6322, Email: ***@vogella.com, Web: http://www.vogella.com
Stephan Aßmus
2018-10-23 08:17:20 UTC
Permalink
Hi,
Post by Eric Williams
We have a patch in gerrit to add support for builder/factory classes
into SWT: https://git.eclipse.org/r/#/c/131348/
Please take a look if you have a moment!
I think the setters should be named set*().

And perhaps it isn't as nice as it could be. There is no way to switch
from one type of builder to another, and to express the layout of the UI
in the code. Something like this would be nice:

void createUI(Composite parent) {
WidgetBuilder.startVGroup(parent)
.startHGroup()
.addLabel()
.setText("Text:")
.end()
.addText()
.setLimit(10)
.end()
.end()
.startHGroup()
.addGlue()
.addButton()
.setText("OK")
.end()
.end()
.end();
}

There are of course numerous alternative ways for the above, of which
the pros and cons can be discussed. But if the end result is the
possibility for such a construct, it would be nice.

Best regards,
-Stephan
Andrey Loskutov
2018-10-23 08:20:22 UTC
Permalink
If I would see that code in the review, I would immediately ask to
rework this. It is not maintainable, not debuggable, and the formatter
will re-format the nice indents by the next possible occasion.
Post by Stephan Aßmus
Hi,
Post by Eric Williams
We have a patch in gerrit to add support for builder/factory classes
into SWT: https://git.eclipse.org/r/#/c/131348/
Please take a look if you have a moment!
I think the setters should be named set*().
And perhaps it isn't as nice as it could be. There is no way to switch
from one type of builder to another, and to express the layout of the UI
void createUI(Composite parent) {
    WidgetBuilder.startVGroup(parent)
        .startHGroup()
            .addLabel()
                .setText("Text:")
                .end()
            .addText()
                .setLimit(10)
                .end()
            .end()
        .startHGroup()
            .addGlue()
            .addButton()
                .setText("OK")
                .end()
            .end()
        .end();
}
There are of course numerous alternative ways for the above, of which
the pros and cons can be discussed. But if the end result is the
possibility for such a construct, it would be nice.
Best regards,
-Stephan
_______________________________________________
platform-swt-dev mailing list
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit
https://dev.eclipse.org/mailman/listinfo/platform-swt-dev
--
Kind regards,
Andrey Loskutov

http://google.com/+AndreyLoskutov
---------------------------------------------
Спасение утопающих - дело рук самих утопающих
---------------------------------------------
Stephan Aßmus
2018-10-23 08:40:58 UTC
Permalink
Hi,
Post by Andrey Loskutov
If I would see that code in the review, I would immediately ask to
rework this. It is not maintainable, not debuggable, and the formatter
will re-format the nice indents by the next possible occasion.
I find that a rather unsubstatiated reasoning.

There are many ways in which code can be "not maintainable". I think the
builder pattern's intention is to increase "maintainability" by
increasing the expressiveness of code by making it as compact as
possible, removing any unnecessary "cruft".

Why such code would not be debuggable is not clear to me.

I am aware that auto-formatting can ruin the indentation which is
important for the expressiveness of the code. That seems to be a problem
of the tooling, though.

Best regards,
-Stephan
Post by Andrey Loskutov
Post by Stephan Aßmus
Hi,
Post by Eric Williams
We have a patch in gerrit to add support for builder/factory classes
into SWT: https://git.eclipse.org/r/#/c/131348/
Please take a look if you have a moment!
I think the setters should be named set*().
And perhaps it isn't as nice as it could be. There is no way to switch
from one type of builder to another, and to express the layout of the
void createUI(Composite parent) {
     WidgetBuilder.startVGroup(parent)
         .startHGroup()
             .addLabel()
                 .setText("Text:")
                 .end()
             .addText()
                 .setLimit(10)
                 .end()
             .end()
         .startHGroup()
             .addGlue()
             .addButton()
                 .setText("OK")
                 .end()
             .end()
         .end();
}
There are of course numerous alternative ways for the above, of which
the pros and cons can be discussed. But if the end result is the
possibility for such a construct, it would be nice.
Best regards,
-Stephan
_______________________________________________
platform-swt-dev mailing list
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/platform-swt-dev
Lars Vogel
2018-10-23 09:23:26 UTC
Permalink
Stephan, please add your feedback to the Gerrit review.
Post by Stephan Aßmus
Hi,
Post by Eric Williams
We have a patch in gerrit to add support for builder/factory classes
into SWT: https://git.eclipse.org/r/#/c/131348/
Please take a look if you have a moment!
I think the setters should be named set*().
And perhaps it isn't as nice as it could be. There is no way to switch
from one type of builder to another, and to express the layout of the UI
void createUI(Composite parent) {
WidgetBuilder.startVGroup(parent)
.startHGroup()
.addLabel()
.setText("Text:")
.end()
.addText()
.setLimit(10)
.end()
.end()
.startHGroup()
.addGlue()
.addButton()
.setText("OK")
.end()
.end()
.end();
}
There are of course numerous alternative ways for the above, of which
the pros and cons can be discussed. But if the end result is the
possibility for such a construct, it would be nice.
Best regards,
-Stephan
_______________________________________________
platform-swt-dev mailing list
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit
https://dev.eclipse.org/mailman/listinfo/platform-swt-dev
Stephan Aßmus
2018-10-23 10:01:03 UTC
Permalink
Hi,
Post by Lars Vogel
Stephan, please add your feedback to the Gerrit review.
For that I need an account and it wasn't immediately obvious to me how
to create one. There was no "register" link and thus I thought this is
only for people who are already committers.

Best regards,
-Stephan
Post by Lars Vogel
Hi,
Post by Eric Williams
We have a patch in gerrit to add support for builder/factory classes
into SWT: https://git.eclipse.org/r/#/c/131348/
Please take a look if you have a moment!
I think the setters should be named set*().
And perhaps it isn't as nice as it could be. There is no way to switch
from one type of builder to another, and to express the layout of the UI
void createUI(Composite parent) {
     WidgetBuilder.startVGroup(parent)
         .startHGroup()
             .addLabel()
                 .setText("Text:")
                 .end()
             .addText()
                 .setLimit(10)
                 .end()
             .end()
         .startHGroup()
             .addGlue()
             .addButton()
                 .setText("OK")
                 .end()
             .end()
         .end();
}
There are of course numerous alternative ways for the above, of which
the pros and cons can be discussed. But if the end result is the
possibility for such a construct, it would be nice.
Best regards,
-Stephan
_______________________________________________
platform-swt-dev mailing list
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/platform-swt-dev
_______________________________________________
platform-swt-dev mailing list
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/platform-swt-dev
Lars Vogel
2018-10-24 05:24:33 UTC
Permalink
You can create a user via bugzilla: https://bugs.eclipse.org
Post by Stephan Aßmus
Hi,
Post by Lars Vogel
Stephan, please add your feedback to the Gerrit review.
For that I need an account and it wasn't immediately obvious to me how
to create one. There was no "register" link and thus I thought this is
only for people who are already committers.
Best regards,
-Stephan
Post by Lars Vogel
Hi,
Post by Eric Williams
We have a patch in gerrit to add support for builder/factory
classes
Post by Lars Vogel
Post by Eric Williams
into SWT: https://git.eclipse.org/r/#/c/131348/
Please take a look if you have a moment!
I think the setters should be named set*().
And perhaps it isn't as nice as it could be. There is no way to
switch
Post by Lars Vogel
from one type of builder to another, and to express the layout of the UI
void createUI(Composite parent) {
WidgetBuilder.startVGroup(parent)
.startHGroup()
.addLabel()
.setText("Text:")
.end()
.addText()
.setLimit(10)
.end()
.end()
.startHGroup()
.addGlue()
.addButton()
.setText("OK")
.end()
.end()
.end();
}
There are of course numerous alternative ways for the above, of which
the pros and cons can be discussed. But if the end result is the
possibility for such a construct, it would be nice.
Best regards,
-Stephan
_______________________________________________
platform-swt-dev mailing list
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/platform-swt-dev
_______________________________________________
platform-swt-dev mailing list
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit
Post by Lars Vogel
https://dev.eclipse.org/mailman/listinfo/platform-swt-dev
_______________________________________________
platform-swt-dev mailing list
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit
https://dev.eclipse.org/mailman/listinfo/platform-swt-dev
Thomas Singer
2018-10-23 09:09:51 UTC
Permalink
Hi Eric,

If I understand it correctly, these builders are not essential for SWT.
I'd put them to a separate library/repository that _uses_ the SWT
library and just might simplify the developer code a little bit.

Please keep the core of the SWT libraries as small as possible.
--
Best regards,
Thomas Singer
=============
syntevo GmbH
https://www.syntevo.com
https://www.syntevo.com/blog
Post by Eric Williams
Hello everyone,
We have a patch in gerrit to add support for builder/factory classes
into SWT: https://git.eclipse.org/r/#/c/131348/
Please take a look if you have a moment!
Loading...