Re: [BLACKBOX] Plugin message handlers

From: Douglas G. Danforth <"Douglas>
Date: Thu, 24 May 2012 14:28:41 -0700

----boundary-LibPST-iamunique-110751896_-_- Content-type: text/plain Bernhard, Good points. Now here is with what I have to deal. PROCEDURE (v: View) HandlePropMsg- (VAR msg: Properties.Message), EXTENSIBLE; BEGIN WITH | msg: Properties.SizePref DO IF v.Size # NIL THEN v.Size(v, msg) END; | msg: Properties.ResizePref DO IF v.Resize # NIL THEN v.Resize(v, msg) END; ELSE END END HandlePropMsg; That is, I have an abstract view (MyViews.View) which is an extension of Views.View that implements HandlePropMsg, once an for all by calling a 'Size' procedure variable. Now if I use your idea then what you are suggesting is I replace that procedure with an object with a 'Size' method. Something like TYPE SizeObject = POINTER TO ABSTRACT RECORD END; PROCEDURE (o: SizeObject) Size (v: MyViews.View), NEW, ABSTRACT; The reason I need to have v be a view belonging to MyViews rather than Views.View is that I may need to get the size of the view from v and not from v.context. So your suggestion adds another layer, another concept, to the pot, whereas all I need to do now is to define PROCEDURE Size(v: MyViews.View; msg: Properties.Message); BEGIN ... END Size; I'll think more about your suggestion. -Doug On 5/24/2012 12:27 AM, Treutwein Bernhard wrote: Hi Doug, as far as I know, usgae of procedure variables is not recommended, but instead you should use factories which provide new method installations. Most factories are called in BlackBox directories, although I don’t find that name very intuitive. They generally provide also a standard implementation, which can be used as a fallback … Procedure variables bare the danger of pointing to a procedure, which is not available anymore and therefore severe crashes. As far as I know, procedure variables cannot be garbage collected (as opposed to methods). Regards -- Bernhard ---- To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to LISTSERV{([at]})nowhere.xy ----boundary-LibPST-iamunique-110751896_-_- Content-type: text/html Bernhard,
Good points.  Now here is with what I have to deal.

    PROCEDURE (v: View) HandlePropMsg- (VAR msg: Properties.Message), EXTENSIBLE;
    BEGIN
        WITH
        | msg: Properties.SizePref DO
            IF v.Size # NIL THEN v.Size(v, msg) END;
        | msg: Properties.ResizePref DO
            IF v.Resize # NIL THEN v.Resize(v, msg) END;
        ELSE
        END
    END HandlePropMsg;

That is, I have an abstract view (MyViews.View) which is an extension of Views.View that
implements HandlePropMsg, once an for all by calling a 'Size' procedure variable.
 Now if I use your idea then what you are suggesting is I replace that procedure with an
object with a 'Size' method.   Something like

TYPE
  SizeObject = POINTER TO ABSTRACT RECORD END;

PROCEDURE (o: SizeObject) Size (v: MyViews.View), NEW, ABSTRACT;

The reason I need to have v be a view belonging to MyViews rather than Views.View is that
I may need to get the size of the view from v and not from v.context.

So your suggestion adds another layer, another concept, to the pot, whereas all I need to do now
is to define

    PROCEDURE Size(v: MyViews.View; msg: Properties.Message); BEGIN ... END Size;

I'll think more about your suggestion.
-Doug

On 5/24/2012 12:27 AM, Treutwein Bernhard wrote:

Hi Doug,

 

as far as I know, usgae of procedure variables is not recommended, but instead you should use

factories which provide new method installations. Most factories are called in BlackBox directories,

although I don’t find that name very intuitive. They generally provide also a standard implementation,

which can be used as a fallback …

 

Procedure variables bare the danger of pointing to a procedure, which is not available anymore

and therefore severe crashes. As far as I know, procedure variables cannot be garbage collected

(as opposed to methods).

 

Regards

--

   Bernhard


---- To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to LISTSERV{([at]})nowhere.xy ----boundary-LibPST-iamunique-110751896_-_--- Received on Thu May 24 2012 - 23:28:41 UTC

This archive was generated by hypermail 2.3.0 : Thu Sep 26 2013 - 06:30:02 UTC