CLASS and USE-WIDGET-POOL - Forum - OpenEdge Development - Progress Community
 Forum

CLASS and USE-WIDGET-POOL

This question is answered

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?

Jeff Ledbetter

Roundtable Product Architect

www.roundtable-software.com

Verified Answer
  • 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.

    Architect of the SmartComponent Library and WinKit

    Consultingwerk Ltd.

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

  • 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.

    Architect of the SmartComponent Library and WinKit

    Consultingwerk Ltd.

  • > 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. :)

    Jeff Ledbetter

    Roundtable Product Architect

    www.roundtable-software.com

  • 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.

    Architect of the SmartComponent Library and WinKit

    Consultingwerk Ltd.

  • 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).
     
  • 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.