CLASS and USE-WIDGET-POOL

Posted by Jeff Ledbetter on 19-Jul-2017 12:58

Hi.

In one of our projects, we got into the habit of using the USE-WIDGET-POOL qualifier on our CLASS statements. However, I never see this used much in OO ABL examples. I know why we did it, but I am now wondering if there is a "best practice" when it comes to using it. 

Thoughts?

Posted by Mike Fechner on 19-Jul-2017 14:44

A) it's not needed when the class is not creating dynamic widgets
B) it's counter productive for query or buffer factories, as the widgets may need to live longer than the factory.

Sent from Nine

Von: Jeff Ledbetter <bounce-jeffledbetter@community.progress.com>
Gesendet: 20.07.2017 4:00 vorm.
An: TU.OE.Development@community.progress.com
Betreff: [Technical Users - OE Development] CLASS and USE-WIDGET-POOL

Update from Progress Community
Jeff Ledbetter

Hi.

In one of our projects, we got into the habit of using the USE-WIDGET-POOL qualifier on our CLASS statements. However, I never see this used much in OO ABL examples. I know why we did it, but I am now wondering if there is a "best practice" when it comes to using it. 

Thoughts?

View online

 

You received this notification because you subscribed to the forum.  To stop receiving updates from only this thread, go here.

Flag this post as spam/abuse.

All Replies

Posted by jquerijero on 19-Jul-2017 14:27

My initial thought is that the concept of needing USE-WIDGET-POOL in the first place is anti-OO but that's just me.

Posted by Mike Fechner on 19-Jul-2017 14:44

A) it's not needed when the class is not creating dynamic widgets
B) it's counter productive for query or buffer factories, as the widgets may need to live longer than the factory.

Sent from Nine

Von: Jeff Ledbetter <bounce-jeffledbetter@community.progress.com>
Gesendet: 20.07.2017 4:00 vorm.
An: TU.OE.Development@community.progress.com
Betreff: [Technical Users - OE Development] CLASS and USE-WIDGET-POOL

Update from Progress Community
Jeff Ledbetter

Hi.

In one of our projects, we got into the habit of using the USE-WIDGET-POOL qualifier on our CLASS statements. However, I never see this used much in OO ABL examples. I know why we did it, but I am now wondering if there is a "best practice" when it comes to using it. 

Thoughts?

View online

 

You received this notification because you subscribed to the forum.  To stop receiving updates from only this thread, go here.

Flag this post as spam/abuse.

Posted by Jeff Ledbetter on 19-Jul-2017 17:23

> A) it's not needed when the class is not creating dynamic widgets

Thanks for the clarification Mike. That is what I thought. It started out that way and then just bled over as a bad habit as other class files were created.

Factories for queries and buffers? You're going to upset the OO-purists. :)

Posted by Mike Fechner on 19-Jul-2017 18:18

I can live with that, Jeff


Sent from Nine

Von: Jeff Ledbetter <bounce-jeffledbetter@community.progress.com>
Gesendet: 20.07.2017 8:30 vorm.
An: TU.OE.Development@community.progress.com
Betreff: RE: [Technical Users - OE Development] CLASS and USE-WIDGET-POOL

Update from Progress Community
Jeff Ledbetter

> A) it's not needed when the class is not creating dynamic widgets

Thanks for the clarification Mike. That is what I thought. It started out that way and then just bled over as a bad habit as other class files were created.

Factories for queries and buffers? You're going to upset the OO-purists. :)

View online

 

You received this notification because you subscribed to the forum.  To unsubscribe from only this thread, go here.

Flag this post as spam/abuse.

Posted by Peter Judge on 24-Jul-2017 21:08

It is a little odd but less so when you consider that it applies to dynamic handles and you can create handles anywhere in a class. I do not know how U-W-P  works when it’s defined only partly through a class hierarchy.
 
If you want to be more clear it may make sense to have handle variables that are PRIVATE to the class, and add a destructor to kill them when the class is destroyed. You will need to think carefully about using those handles for INPUT  or OUTPUT in public members (since at the point you don’t know who is using them).
 

Posted by jquerijero on 25-Jul-2017 09:48

I'm trying to remember, way back, there is also a problem with temp-table if the window class is instantiated and shown by a .p/.w and the .p/.w finishes its work while the window stays open. If USE-WIDGET-HANDLE is not used, temp-table is might be scoped to the .p/.w and not to the class, so temp-table defined inside the class goes away together with the .p/.w or whichever widget pool is currently active.

This thread is closed