RE: RE: [jade-develop] About register... and handle... functions


Subject: RE: RE: [jade-develop] About register... and handle... functions
From: Bellifemine Fabio (Fabio.Bellifemine@TILAB.COM)
Date: Mon Dec 16 2002 - 16:14:39 MET


Perhaps the following simple example might help.

Imagine the case when you have a state Sx of a FSM (Finite State Machine), that is itself another FSM, let's call it Mx.
In such a case you must use the registerXXX methods in order to register a Behaviour to act as the handler of the state of another behaviour. The exit transition from the state will be executed only when that Behaviour is terminated.

In alternative, the handleXXX methods are basically callbacks for the state and the transition is executed as soon as the method terminates.

Fabio.

> -----Original Message-----
> From: tao_gu@263.net [mailto:tao_gu@263.net]
> Sent: 14 December 2002 05:18
> To: fabio.bellifemine@TILAB.COM
> Subject: Re:RE: [jade-develop] About register... and
> handle... functions
>
>
>
> Yes. I have read through the programmer's guide and what it
> says about these two kinks of functions as you have described.
> I still can not understand it very well probably because I am
> not a skilled programmer ^O^
>
> Could you give some examples to illustrate the problem?
>
> Thank you very much.
> Regards
>
>
> ----- Original Message -----
> From: "Bellifemine Fabio" <Fabio.Bellifemine@TILAB.COM>
> To: <tao_gu@263.net>,<jade-develop@sharon.cselt.it>
> Sent: 2002-12-14 07:17:51
> Subject: RE: [jade-develop] About register... and handle... functions
>
>
>
>
>
>
> >Please read the programmer's guide, section 3.5,
> >
> >"The class can be easily extended by overriding one (or all)
> of its handle... callback methods
> >which provide hooks to handle all the states of the
> protocol. For instance the method
> >handleRefuse is called when a refuse message is received.
> >Skilled programmers might find useful, instead of extending
> this class and overriding some
> >of its methods, registering application-specific Behaviours
> as handler of the states of the protocol,
> >including, for instance, another AchieveREInitiator
> behaviour to request a password before
> >agreeing to perform the communicative act. The methods
> registerHandle... allow to do that. A
> >mix of overridden methods and registered behaviours might
> often be the best solution. [...]"
> >
> >http://jade.cselt.it/doc/programmersguide.pdf
> >
> >> -----Original Message-----
> >> From: tao_gu@263.net [mailto:tao_gu@263.net]
> >> Sent: 13 December 2002 06:15
> >> To: jade-develop@sharon.cselt.it
> >> Subject: [jade-develop] About register... and handle... functions
> >>
> >>
> >> I notice that in the jade.proto package most behaviours have
> >> handle... functions and register... functions. I understand
> >> the useage of the handle functions because they are basically
> >> call-back function for message processing. But according to
> >> the JADE programmer's manual the register... functions are
> >> alternatives of the handle... functions and they seem more
> >> advanced than handle... fucntions.
> >>
> >> Can anybody tell me the mechanisms of the register...
> >> functions? And what is the difference between these two kinds
> >> of functions?
> >>
> >>
> >> _______________________________________________
> >> jade-develop mailing list
> >> jade-develop@sharon.cselt.it
> >> http://sharon.cselt.it/mailman/listinfo/jade-develop
> >> UNSUBSCRIBE INSTRUCTIONS AT
> >> http://jade.cselt.it/mailing.htm#unsubscribe
> >>
> >_______________________________________________
> >jade-develop mailing list
> >jade-develop@sharon.cselt.it
> >http://sharon.cselt.it/mailman/listinfo/jade-develop
> >UNSUBSCRIBE INSTRUCTIONS AT
> http://jade.cselt.it/mailing.htm#unsubscribe
>



This archive was generated by hypermail 2a22 : Mon Dec 16 2002 - 16:14:55 MET