Glimmer DSL for SWT Table Cell Data-Binding of Background/Foreground/Font/Image

Glimmer was the first software library to enable data-binding a full table
with a single line of code! Well, now it does even more as it also
data-binds table cell background color, foreground color, font, and image
with that same single line of code!

···

--
Andy Maleh

LinkedIn: https://www.linkedin.com/in/andymaleh
<https://www.linkedin.com/in/andymaleh&gt;
Blog: http://andymaleh.blogspot.com
GitHub: AndyObtiva (Andy Maleh) · GitHub
Twitter: @AndyObtiva <https://twitter.com/AndyObtiva&gt;

No, it wasn't. Smalltalk (80s), nextstep (90s), cocoa (etc)...

and half of those let you do it w/ essentially zero lines of code

···

On Aug 30, 2022, at 17:59, Andy Maleh <andy.am@gmail.com> wrote:

Glimmer was the first software library to enable data-binding a full table with a single line of code!

Well, zero lines of code is not the same as a single line of code! Hahaha!

···

On Thu, Sep 1, 2022 at 6:31 AM Ryan Davis <ryand-ruby@zenspider.com> wrote:

> On Aug 30, 2022, at 17:59, Andy Maleh <andy.am@gmail.com> wrote:
>
> Glimmer was the first software library to enable data-binding a full
table with a single line of code!

No, it wasn't. Smalltalk (80s), nextstep (90s), cocoa (etc)...

and half of those let you do it w/ essentially zero lines of code

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt;

--
Andy Maleh

LinkedIn: Andy Maleh | LinkedIn
<https://www.linkedin.com/in/andymaleh&gt;
Blog: http://andymaleh.blogspot.com
GitHub: AndyObtiva (Andy Maleh) · GitHub
Twitter: @AndyObtiva <https://twitter.com/AndyObtiva&gt;

In any case, if you know of a way of data-binding a table with zero lines
of code, please feel free to contribute to Glimmer to help make it better.

···

On Thu, Sep 1, 2022 at 12:09 PM Andy Maleh <andy.am@gmail.com> wrote:

Well, zero lines of code is not the same as a single line of code! Hahaha!

On Thu, Sep 1, 2022 at 6:31 AM Ryan Davis <ryand-ruby@zenspider.com> > wrote:

> On Aug 30, 2022, at 17:59, Andy Maleh <andy.am@gmail.com> wrote:
>
> Glimmer was the first software library to enable data-binding a full
table with a single line of code!

No, it wasn't. Smalltalk (80s), nextstep (90s), cocoa (etc)...

and half of those let you do it w/ essentially zero lines of code

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt;

--
Andy Maleh

LinkedIn: Andy Maleh | LinkedIn
<https://www.linkedin.com/in/andymaleh&gt;
Blog: http://andymaleh.blogspot.com
GitHub: AndyObtiva (Andy Maleh) · GitHub
Twitter: @AndyObtiva <https://twitter.com/AndyObtiva&gt;

--
Andy Maleh

LinkedIn: Andy Maleh | LinkedIn
<https://www.linkedin.com/in/andymaleh&gt;
Blog: http://andymaleh.blogspot.com
GitHub: AndyObtiva (Andy Maleh) · GitHub
Twitter: @AndyObtiva <https://twitter.com/AndyObtiva&gt;

Smalltalk (80s), nextstep (90s), cocoa (etc).

To help others who might not know what you are talking about, could you
please provide examples, details, code, and/or screenshots demonstrating
how table bidirectional data-binding can be done in Smalltalk, nextstep,
cocoa, etc... with essentially zero lines of code?

···

On Thu, Sep 1, 2022 at 12:12 PM Andy Maleh <andy.am@gmail.com> wrote:

In any case, if you know of a way of data-binding a table with zero lines
of code, please feel free to contribute to Glimmer to help make it better.

On Thu, Sep 1, 2022 at 12:09 PM Andy Maleh <andy.am@gmail.com> wrote:

Well, zero lines of code is not the same as a single line of code! Hahaha!

On Thu, Sep 1, 2022 at 6:31 AM Ryan Davis <ryand-ruby@zenspider.com> >> wrote:

> On Aug 30, 2022, at 17:59, Andy Maleh <andy.am@gmail.com> wrote:
>
> Glimmer was the first software library to enable data-binding a full
table with a single line of code!

No, it wasn't. Smalltalk (80s), nextstep (90s), cocoa (etc)...

and half of those let you do it w/ essentially zero lines of code

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org
?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt;

--
Andy Maleh

LinkedIn: Andy Maleh | LinkedIn
<https://www.linkedin.com/in/andymaleh&gt;
Blog: http://andymaleh.blogspot.com
GitHub: AndyObtiva (Andy Maleh) · GitHub
Twitter: @AndyObtiva <https://twitter.com/AndyObtiva&gt;

--
Andy Maleh

LinkedIn: Andy Maleh | LinkedIn
<https://www.linkedin.com/in/andymaleh&gt;
Blog: http://andymaleh.blogspot.com
GitHub: AndyObtiva (Andy Maleh) · GitHub
Twitter: @AndyObtiva <https://twitter.com/AndyObtiva&gt;

--
Andy Maleh

LinkedIn: Andy Maleh | LinkedIn
<https://www.linkedin.com/in/andymaleh&gt;
Blog: http://andymaleh.blogspot.com
GitHub: AndyObtiva (Andy Maleh) · GitHub
Twitter: @AndyObtiva <https://twitter.com/AndyObtiva&gt;

By the way, I just noticed that you actually said "half of those". Sorry
for missing this earlier. That might imply that the other half does support
data-binding of a table in a single line of code.

Well, I just updated the blog post to explicitly indicate "*
bidirectional* data-binding of a table with a single line of code
(without using a visual designer/GUI)". I have seen languages/libraries
before that enable developers to populate an initially READ-ONLY table
(unidirectionally) with data using only an option in code or using a Visual
Designer GUI (zero code). I am not a fan of no-code approaches as it is
slower to use the mouse and edit the configuration through a GUI for a
highly experienced software engineer than to change a single line of code.
Still, I have not encountered any languages/libraries out there, including
all the ones you mentioned, that do true BIDIRECTIONAL data-binding with a
single line of code (or even zero code), truly decoupling the table from
the models (following MVP or MVVM pattern) while also ensuring automatic
updates to the table when the models (collection) or model properties are
directly modified at the Model layer alone without touching the table, and
also enabling users to update table cells directly in the GUI and have that
automatically persisted to the models, all happening through that single
line of bidirectional data-binding code (like in Glimmer). All other
libraries will require the developer to hook an additional listener,
viewer, or configuration object in order to listen to table updates that
could be persisted to the models or require touching the table in order to
have it updated from the model layer once the models have changed.

If I am wrong, I'd like to stand corrected. I have real work experience
using VB6, MFC C++ (just a bit), and Java to build desktop GUIs. Also, I
studied Smalltalk-80 as part of my Bachelor of Science in Computer Science
at McGill University (Canada's equivalent of Harvard) and know of
NeXTSTEP/Cocoa because I've worked with people who have built Mac/iOS apps.

Still, everyone makes mistakes, so I could be wrong, and I would like to be
corrected if so by providing concrete examples to help educate me and
others in the Ruby community.

Best,

···

On Thu, Sep 1, 2022 at 12:20 PM Andy Maleh <andy.am@gmail.com> wrote:

> Smalltalk (80s), nextstep (90s), cocoa (etc).

To help others who might not know what you are talking about, could you
please provide examples, details, code, and/or screenshots demonstrating
how table bidirectional data-binding can be done in Smalltalk, nextstep,
cocoa, etc... with essentially zero lines of code?

On Thu, Sep 1, 2022 at 12:12 PM Andy Maleh <andy.am@gmail.com> wrote:

In any case, if you know of a way of data-binding a table with zero lines
of code, please feel free to contribute to Glimmer to help make it better.

On Thu, Sep 1, 2022 at 12:09 PM Andy Maleh <andy.am@gmail.com> wrote:

Well, zero lines of code is not the same as a single line of code!
Hahaha!

On Thu, Sep 1, 2022 at 6:31 AM Ryan Davis <ryand-ruby@zenspider.com> >>> wrote:

> On Aug 30, 2022, at 17:59, Andy Maleh <andy.am@gmail.com> wrote:
>
> Glimmer was the first software library to enable data-binding a full
table with a single line of code!

No, it wasn't. Smalltalk (80s), nextstep (90s), cocoa (etc)...

and half of those let you do it w/ essentially zero lines of code

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org
?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt;

--
Andy Maleh

LinkedIn: Andy Maleh | LinkedIn
<https://www.linkedin.com/in/andymaleh&gt;
Blog: http://andymaleh.blogspot.com
GitHub: AndyObtiva (Andy Maleh) · GitHub
Twitter: @AndyObtiva <https://twitter.com/AndyObtiva&gt;

--
Andy Maleh

LinkedIn: Andy Maleh | LinkedIn
<https://www.linkedin.com/in/andymaleh&gt;
Blog: http://andymaleh.blogspot.com
GitHub: AndyObtiva (Andy Maleh) · GitHub
Twitter: @AndyObtiva <https://twitter.com/AndyObtiva&gt;

--
Andy Maleh

LinkedIn: Andy Maleh | LinkedIn
<https://www.linkedin.com/in/andymaleh&gt;
Blog: http://andymaleh.blogspot.com
GitHub: AndyObtiva (Andy Maleh) · GitHub
Twitter: @AndyObtiva <https://twitter.com/AndyObtiva&gt;

--
Andy Maleh

LinkedIn: Andy Maleh | LinkedIn
<https://www.linkedin.com/in/andymaleh&gt;
Blog: http://andymaleh.blogspot.com
GitHub: AndyObtiva (Andy Maleh) · GitHub
Twitter: @AndyObtiva <https://twitter.com/AndyObtiva&gt;

Hi Andy.

Well, I just updated the blog post to explicitly indicate "***bidirectional*** data-binding of a table with a single line of code **(without using a visual designer/GUI)**". I have seen languages/libraries before that enable developers to populate an initially READ-ONLY table (unidirectionally) with data using only an option in code or using a Visual Designer GUI (zero code). I am not a fan of no-code approaches as it is slower to use the mouse and edit the configuration through a GUI for a highly experienced software engineer than to change a single line of code. Still, I have not encountered any languages/libraries out there, including all the ones you mentioned, that do true BIDIRECTIONAL data-binding with a single line of code (or even zero code), truly decoupling the table from the models (following MVP or MVVM pattern) while also ensuring automatic updates the table when the model collection or model properties are directly modified at the Model layer alone without touching the table, and also enabling users to update table cells directly in the GUI and have that automatically persisted to the models, all happening through that single line of bidirectional data-binding code (like in Glimmer).

It is using a visual designer but I seem to remember that C++ Builder (and naturally Delphi) has the ability to visually attach to a data source using the components (and also to web API responses) and show the results in a grid or a table. If I remember correctly (it has been a while), it also allowed setting something that would let you edit the records. That was one of the early demos of Delphi/ C++ Builder and used to ship with the IDE. Of course, you could attach listeners, etc. to handle the data differently if you wanted. It's called Live Bindings and this video might cover it - https://www.youtube.com/watch?v=NajaQIaXfd8 (I think this one I found in a quick search doesn't cover 2-way updates but I seem to remember that there is way).

Irrespective, I love what you're doing with Glimmer :slight_smile: and what it does for the community of Ruby programmers.

Best regards,
Mohit.

···

On 2022-9-2 2:32 am, Andy Maleh wrote:

Thank you for sharing an example Mohit.

Yes, I do remember that data-binding a table with a Visual Designer/GUI was
possible in Microsoft technologies too.

However, they do not do the same thing Glimmer does. They data-bind Table
(View widget) to a data source (not to a simple Model layer
bidirectionally) and in the video you shared, the Text Field (View widget)
that was editing the Table (View widget) was data-bound directly to the
Table (violating MVC/MVP), not to a Model in the Model layer as an
intermediate that would indirectly relay changes to the Table with the
Observer Pattern.

I am not saying that the data binding capabilities of Apple and Microsoft
technologies aren't impressive. But, they either do not provide the best
separation of concerns or they do not fully support bidirectional
data-binding for the Table widget, which software engineers could get in
Glimmer out of the box. Furthermore, those technologies often required the
developer to supply an extra Controller or even Listener/Observer code
manually in the Model layer. Glimmer, thanks to Ruby, will automatically
observe your simple Models (e.g. with basic Ruby attributes) so that you do
NOT have to implement the Observer Pattern yourself, custom binding
objects, or an extra Controller.

Of course, if truly needed, Glimmer could be augmented further in the
future through custom widgets to support all the different features Visual
Designers provide in Apple and Microsoft technologies.

In any case, again, if I am somehow wrong, and there is a simple example
out there of fully bidirectional table data-binding that does not require
writing extra code at the Model or View layers, then please share it with
us here, and I'll be happy to stand corrected.

Thank you Mohit for your appreciation of Glimmer. I still look forward to
your blog post about it. I think you should not write a long blog post at
first. A small first GUI example should be more than good enough to get the
ball rolling on a blog article series on Glimmer if you're up for it.

Best,

···

On Fri, Sep 2, 2022 at 1:16 AM Mohit Sindhwani <mo_mail@onghu.com> wrote:

Hi Andy.

On 2022-9-2 2:32 am, Andy Maleh wrote:

Well, I just updated the blog post to explicitly indicate "**
*bidirectional*** data-binding of a table with a single line of code
**(without using a visual designer/GUI)**". I have seen languages/libraries
before that enable developers to populate an initially READ-ONLY table
(unidirectionally) with data using only an option in code or using a Visual
Designer GUI (zero code). I am not a fan of no-code approaches as it is
slower to use the mouse and edit the configuration through a GUI for a
highly experienced software engineer than to change a single line of code.
Still, I have not encountered any languages/libraries out there, including
all the ones you mentioned, that do true BIDIRECTIONAL data-binding with a
single line of code (or even zero code), truly decoupling the table from
the models (following MVP or MVVM pattern) while also ensuring automatic
updates the table when the model collection or model properties are
directly modified at the Model layer alone without touching the table, and
also enabling users to update table cells directly in the GUI and have that
automatically persisted to the models, all happening through that single
line of bidirectional data-binding code (like in Glimmer).

It is using a visual designer but I seem to remember that C++ Builder (and
naturally Delphi) has the ability to visually attach to a data source using
the components (and also to web API responses) and show the results in a
grid or a table. If I remember correctly (it has been a while), it also
allowed setting something that would let you edit the records. That was one
of the early demos of Delphi/ C++ Builder and used to ship with the IDE. Of
course, you could attach listeners, etc. to handle the data differently if
you wanted. It's called Live Bindings and this video might cover it -
https://www.youtube.com/watch?v=NajaQIaXfd8 (I think this one I found in
a quick search doesn't cover 2-way updates but I seem to remember that
there is way).

Irrespective, I love what you're doing with Glimmer :slight_smile: and what it does
for the community of Ruby programmers.

Best regards,
Mohit.

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt;

--
Andy Maleh

LinkedIn: Andy Maleh | LinkedIn
<https://www.linkedin.com/in/andymaleh&gt;
Blog: http://andymaleh.blogspot.com
GitHub: AndyObtiva (Andy Maleh) · GitHub
Twitter: @AndyObtiva <https://twitter.com/AndyObtiva&gt;