Loading ...
Sorry, an error occurred while loading the content.

New event manager

Expand Messages
  • Seth Voltz
    ... Hash: SHA1 Hey everyone, So I m considering writing an event handler slightly different than the one in cairngorm and wanted to make sure I can t already
    Message 1 of 4 , Apr 1, 2005
    • 0 Attachment
      -----BEGIN PGP SIGNED MESSAGE-----
      Hash: SHA1

      Hey everyone,

      So I'm considering writing an event handler slightly different than the
      one in cairngorm and wanted to make sure I can't already do it or that
      it doesn't already exist somewhere in a similar form.

      So currently the way events work in cairngorm (at least the way I
      learned them and use them) is I broadcast an event from anywhere, it
      gets picked up by an event commander, passed through a delegator and on
      to a specific location, usually through the use of view helpers.

      Now, this has been real handy for most stuff because all events passed
      only had one destination. Unfortunately, now my app is getting a bit
      more complicated and it has multiple things that need to know when
      something happens. The first solution to this was a "Login Handler"
      (which I'm going to release at some point... probably when I get the
      free time to package it up and document it properly.) which allows any
      class to register itself (either with calls to the static class or
      through a "LoginHelper" which is simply an MXML wrapper for those
      calls) and when the login managers "triggerLogin" function is called,
      it executes the "loginTriggered" function in all registered classes.
      The same goes for "triggerLogout" and "logoutTriggered" respectively.

      So, to recap. I need a better event handler. I want to register classes
      with a master event manager which calls back to all classes when any
      class triggers the specified event. Is this already in existence? Is it
      already in Cairngorm? If not... I'll write it. :)

      Thanks,
      Seth
      -----BEGIN PGP SIGNATURE-----
      Version: GnuPG v1.2.4 (Darwin)

      iD8DBQFCTQNHsnBTlzgQQ28RAtn3AJ9SDu4/gAYecJr7W7BxmDr24/3McQCfZ+aP
      c6D9nvE6LBOwPwHMsYX52Lk=
      =+9qa
      -----END PGP SIGNATURE-----
    • Robert Stuttaford
      Seth, I think you re looking for a way to notify multiple views/other elements when a command is complete. Cairngorm maps a single command to a single event.
      Message 2 of 4 , Apr 1, 2005
      • 0 Attachment
        Seth, I think you're looking for a way to notify multiple views/other
        elements when a command is complete.

        Cairngorm maps a single command to a single event. It doesn't prescribe much
        about what to do when the event is done, but provides ViewLocator to find
        the views you might need to update.

        I think you're possibly looking to formalize a listener list to broadcast to
        for the onResult element of your command class. You could expose logic in
        the front controller to allow views and other classes to listen for command
        completion by command name, and then create a base command class, which
        contains the listen/broadcast functionality, to derive your commands from.

        I guess you could also include a broadcast for the execute, to allow for
        pre-execution logic.

        I've not personally run into a situation where I could use this (done
        nothing big enough, yet :D), but I'm certain this could provide value.

        Give it a go!

        Sunny skies,
        Robert

        -----Original Message-----
        From: Seth Voltz [mailto:tauceti@...]
        Sent: 01 April 2005 10:16 AM
        To: Flex Coders
        Subject: [flexcoders] New event manager


        -----BEGIN PGP SIGNED MESSAGE-----
        Hash: SHA1

        Hey everyone,

        So I'm considering writing an event handler slightly different than the
        one in cairngorm and wanted to make sure I can't already do it or that
        it doesn't already exist somewhere in a similar form.

        So currently the way events work in cairngorm (at least the way I
        learned them and use them) is I broadcast an event from anywhere, it
        gets picked up by an event commander, passed through a delegator and on
        to a specific location, usually through the use of view helpers.

        Now, this has been real handy for most stuff because all events passed
        only had one destination. Unfortunately, now my app is getting a bit
        more complicated and it has multiple things that need to know when
        something happens. The first solution to this was a "Login Handler"
        (which I'm going to release at some point... probably when I get the
        free time to package it up and document it properly.) which allows any
        class to register itself (either with calls to the static class or
        through a "LoginHelper" which is simply an MXML wrapper for those
        calls) and when the login managers "triggerLogin" function is called,
        it executes the "loginTriggered" function in all registered classes.
        The same goes for "triggerLogout" and "logoutTriggered" respectively.

        So, to recap. I need a better event handler. I want to register classes
        with a master event manager which calls back to all classes when any
        class triggers the specified event. Is this already in existence? Is it
        already in Cairngorm? If not... I'll write it. :)

        Thanks,
        Seth
        -----BEGIN PGP SIGNATURE-----
        Version: GnuPG v1.2.4 (Darwin)

        iD8DBQFCTQNHsnBTlzgQQ28RAtn3AJ9SDu4/gAYecJr7W7BxmDr24/3McQCfZ+aP
        c6D9nvE6LBOwPwHMsYX52Lk=
        =+9qa
        -----END PGP SIGNATURE-----




        Yahoo! Groups Links
      • r0main
        Hello, not sure global-multicasting is a better event handling than the Cairngorm s core-handling. In the past a good software re-design allowed me to skip a
        Message 3 of 4 , Apr 1, 2005
        • 0 Attachment
          Hello,
          not sure global-multicasting is a "better" event handling than the
          Cairngorm's core-handling.
          In the past a good software re-design allowed me to skip a lot of
          requirements I was asking Steven to put into Cairngorm, like event
          sequencing...

          Can't a central model fit your need ?
          (updated by one command or action, but with many bindings destination
          across the application) ?

          Romain


          --- In flexcoders@yahoogroups.com, "Robert Stuttaford" <robert@w...>
          wrote:
          > Seth, I think you're looking for a way to notify multiple
          views/other
          > elements when a command is complete.
          >
          > Cairngorm maps a single command to a single event. It doesn't
          prescribe much
          > about what to do when the event is done, but provides ViewLocator to
          find
          > the views you might need to update.
          >
          > I think you're possibly looking to formalize a listener list to
          broadcast to
          > for the onResult element of your command class. You could expose
          logic in
          > the front controller to allow views and other classes to listen for
          command
          > completion by command name, and then create a base command class,
          which
          > contains the listen/broadcast functionality, to derive your commands
          from.
          >
          > I guess you could also include a broadcast for the execute, to
          allow for
          > pre-execution logic.
          >
          > I've not personally run into a situation where I could use this
          (done
          > nothing big enough, yet :D), but I'm certain this could provide
          value.
          >
          > Give it a go!
          >
          > Sunny skies,
          > Robert
          >
          > -----Original Message-----
          > From: Seth Voltz [mailto:tauceti@d...]
          > Sent: 01 April 2005 10:16 AM
          > To: Flex Coders
          > Subject: [flexcoders] New event manager
          >
          >
          > -----BEGIN PGP SIGNED MESSAGE-----
          > Hash: SHA1
          >
          > Hey everyone,
          >
          > So I'm considering writing an event handler slightly different than
          the
          > one in cairngorm and wanted to make sure I can't already do it or
          that
          > it doesn't already exist somewhere in a similar form.
          >
          > So currently the way events work in cairngorm (at least the way I
          > learned them and use them) is I broadcast an event from anywhere,
          it
          > gets picked up by an event commander, passed through a delegator
          and on
          > to a specific location, usually through the use of view helpers.
          >
          > Now, this has been real handy for most stuff because all events
          passed
          > only had one destination. Unfortunately, now my app is getting a
          bit
          > more complicated and it has multiple things that need to know when
          > something happens. The first solution to this was a "Login Handler"
          > (which I'm going to release at some point... probably when I get
          the
          > free time to package it up and document it properly.) which allows
          any
          > class to register itself (either with calls to the static class or
          > through a "LoginHelper" which is simply an MXML wrapper for those
          > calls) and when the login managers "triggerLogin" function is
          called,
          > it executes the "loginTriggered" function in all registered
          classes.
          > The same goes for "triggerLogout" and "logoutTriggered"
          respectively.
          >
          > So, to recap. I need a better event handler. I want to register
          classes
          > with a master event manager which calls back to all classes when
          any
          > class triggers the specified event. Is this already in existence?
          Is it
          > already in Cairngorm? If not... I'll write it. :)
          >
          > Thanks,
          > Seth
          > -----BEGIN PGP SIGNATURE-----
          > Version: GnuPG v1.2.4 (Darwin)
          >
          > iD8DBQFCTQNHsnBTlzgQQ28RAtn3AJ9SDu4/gAYecJr7W7BxmDr24/3McQCfZ+aP
          > c6D9nvE6LBOwPwHMsYX52Lk=
          > =+9qa
          > -----END PGP SIGNATURE-----
          >
          >
          >
          >
          > Yahoo! Groups Links
        • Seth Voltz
          ... Hash: SHA1 I m not sure I understand what you mean by a central model I can t hard code a single class to send requests to many places if that s what
          Message 4 of 4 , Apr 1, 2005
          • 0 Attachment
            -----BEGIN PGP SIGNED MESSAGE-----
            Hash: SHA1

            I'm not sure I understand what you mean by a "central model"

            I can't hard code a single class to send requests to many places if
            that's what you're suggesting. The reason for this is I'm developing a
            core application that can have any number of modules loaded into it.
            The purpose of the EventManager class would be when a module loads, it
            registers itself for events then sits back and waits.

            If it's not something that exists already, however, it's not a big
            deal. I have a lot of code ready for conversion.

            Thanks,
            Seth

            On Apr 01, 2005, at 07:13, r0main wrote:

            >
            >
            > Hello,
            > not sure global-multicasting is a "better" event handling than the
            > Cairngorm's core-handling.
            > In the past a good software re-design allowed me to skip a lot of
            > requirements I was asking Steven to put into Cairngorm, like event
            > sequencing...
            >
            > Can't a central model fit your need ?
            > (updated by one command or action, but with many bindings destination
            > across the application) ?
            >
            > Romain
            >
            >
            > --- In flexcoders@yahoogroups.com, "Robert Stuttaford" <robert@w...>
            > wrote:
            >> Seth, I think you're looking for a way to notify multiple
            > views/other
            >> elements when a command is complete.
            >>
            >> Cairngorm maps a single command to a single event. It doesn't
            > prescribe much
            >> about what to do when the event is done, but provides ViewLocator to
            > find
            >> the views you might need to update.
            >>
            >> I think you're possibly looking to formalize a listener list to
            > broadcast to
            >> for the onResult element of your command class. You could expose
            > logic in
            >> the front controller to allow views and other classes to listen for
            > command
            >> completion by command name, and then create a base command class,
            > which
            >> contains the listen/broadcast functionality, to derive your commands
            > from.
            >>
            >> I guess you could also include a broadcast for the execute, to
            > allow for
            >> pre-execution logic.
            >>
            >> I've not personally run into a situation where I could use this
            > (done
            >> nothing big enough, yet :D), but I'm certain this could provide
            > value.
            >>
            >> Give it a go!
            >>
            >> Sunny skies,
            >> Robert
            >>
            >> -----Original Message-----
            >> From: Seth Voltz [mailto:tauceti@d...]
            >> Sent: 01 April 2005 10:16 AM
            >> To: Flex Coders
            >> Subject: [flexcoders] New event manager
            >>
            >>
            >> -----BEGIN PGP SIGNED MESSAGE-----
            >> Hash: SHA1
            >>
            >> Hey everyone,
            >>
            >> So I'm considering writing an event handler slightly different than
            > the
            >> one in cairngorm and wanted to make sure I can't already do it or
            > that
            >> it doesn't already exist somewhere in a similar form.
            >>
            >> So currently the way events work in cairngorm (at least the way I
            >> learned them and use them) is I broadcast an event from anywhere,
            > it
            >> gets picked up by an event commander, passed through a delegator
            > and on
            >> to a specific location, usually through the use of view helpers.
            >>
            >> Now, this has been real handy for most stuff because all events
            > passed
            >> only had one destination. Unfortunately, now my app is getting a
            > bit
            >> more complicated and it has multiple things that need to know when
            >> something happens. The first solution to this was a "Login Handler"
            >> (which I'm going to release at some point... probably when I get
            > the
            >> free time to package it up and document it properly.) which allows
            > any
            >> class to register itself (either with calls to the static class or
            >> through a "LoginHelper" which is simply an MXML wrapper for those
            >> calls) and when the login managers "triggerLogin" function is
            > called,
            >> it executes the "loginTriggered" function in all registered
            > classes.
            >> The same goes for "triggerLogout" and "logoutTriggered"
            > respectively.
            >>
            >> So, to recap. I need a better event handler. I want to register
            > classes
            >> with a master event manager which calls back to all classes when
            > any
            >> class triggers the specified event. Is this already in existence?
            > Is it
            >> already in Cairngorm? If not... I'll write it. :)
            >>
            >> Thanks,
            >> Seth
            >> -----BEGIN PGP SIGNATURE-----
            >> Version: GnuPG v1.2.4 (Darwin)
            >>
            >> iD8DBQFCTQNHsnBTlzgQQ28RAtn3AJ9SDu4/gAYecJr7W7BxmDr24/3McQCfZ+aP
            >> c6D9nvE6LBOwPwHMsYX52Lk=
            >> =+9qa
            >> -----END PGP SIGNATURE-----
            >>
            >>
            >>
            >>
            >> Yahoo! Groups Links
            >
            >
            >
            >
            >
            >
            > Yahoo! Groups Links
            >
            >
            >
            >
            >
            >
            -----BEGIN PGP SIGNATURE-----
            Version: GnuPG v1.2.4 (Darwin)

            iD8DBQFCTcPMsnBTlzgQQ28RAo9vAJsHWmcu8rQm8VjWxpMEsKp39PmpKwCaAosA
            GZl+PCBgAycOkNOWlefutUc=
            =oDeW
            -----END PGP SIGNATURE-----
          Your message has been successfully submitted and would be delivered to recipients shortly.