Event Handling using Design Patterns & some hard questions

Discussion in 'C Programming' started by firehead.satish@gmail.com, Jan 11, 2008.

  1. Guest

    Hello Comp.Lang.C


    I have been reading some documentation on the QT 4.0 signalling
    systems. I read somewhere that the Signal/Slot systems is based on a
    Observer Pattern.

    This is where I do not understand. A slot is 'Prototype' that contains
    parametres that determines the behaviour of an object.
    In this context how can the pattern 'Prototype' become an object
    itself?

    I am looking for algorithms for implementing an event-handling system
    using Design patterns without the use of templates or the use of third
    party software.

    I know that a Signal is an event which has state therefore an event is
    considered a 'State' patttern.
    A Command patterns executes a prototype/ slot.

    Can a Prototype object specify the behaviour of an event? That is, can
    a Prototype pattern specify what Signals/ events are available for an
    object such as TextBox or a Button?

    How can I specify using design patterns; what parametres are available
    for an method?
    For example:
    button_Clicked methods has no arguments but later on I want to modify
    the behaviour, How can I use the Prototype/Command pattern to modify
    the behaviour?


    The similarity between Signal and Slots with Design Pattern is as
    follows.

    An observer patterns observes other Observers.
    A observer patterns contains many Signals ( State Pattern).
    A Signal can contains 1 or many Protoypes/ Command Pattern.

    When a observer asynchronously invokes different observer containing a
    Signal/State it would then invoke Slots particular to the Signal. For
    this to happen I would have to use a Proxy or a Delegate Pattern?

    Could someone help out please?



    Satish
     
    , Jan 11, 2008
    #1
    1. Advertising

  2. <> wrote in message
    news:...
    > Hello Comp.Lang.C

    [...]
    > When a observer asynchronously invokes different observer containing a
    > Signal/State it would then invoke Slots particular to the Signal. For
    > this to happen I would have to use a Proxy or a Delegate Pattern?
    >
    > Could someone help out please?


    This is not really a C question... It more of an algorithm design question.
    You can try 'comp.programming' or something. Anyway, FWIW here is a very
    brief diagram of an overview for a multi-threaded event-distribution scheme
    I did for some ARM-based embedded devices running Quadros:

    http://appcore.home.comcast.net/~appcore/vzoom/msgsys.pdf

    I did this in C and ARM assembly language for the thread synchronization
    stuff. I used a simple abstract interface method in the implementation (for
    the delegate/event/observer data-structures):

    http://groups.google.com/group/comp.lang.c/browse_frm/thread/1b106926ba5db19f

    I think might be able to help you some wrt creating your event framework in
    C. Also, if you plan on using threads in this thing, be sure to post over in
    'comp.programming.threads'!

    :^)
     
    Chris Thomasson, Jan 11, 2008
    #2
    1. Advertising

  3. "Chris Thomasson" <> wrote in message
    news:...
    > <> wrote in message
    > news:...
    >> Hello Comp.Lang.C

    > [...]
    >> When a observer asynchronously invokes different observer containing a
    >> Signal/State it would then invoke Slots particular to the Signal. For
    >> this to happen I would have to use a Proxy or a Delegate Pattern?
    >>
    >> Could someone help out please?

    >
    > This is not really a C question... It more of an algorithm design
    > question. You can try 'comp.programming' or something. Anyway, FWIW here
    > is a very brief diagram of an overview for a multi-threaded
    > event-distribution scheme I did for some ARM-based embedded devices
    > running Quadros:
    >
    > http://appcore.home.comcast.net/~appcore/vzoom/msgsys.pdf
    >

    [...]

    This uses a single distributor thread... If you want to learn how to use
    multiple distributors, ask over in 'comp.programming.threads'...
     
    Chris Thomasson, Jan 11, 2008
    #3
  4. Al Balmer Guest

    On Thu, 10 Jan 2008 18:10:23 -0800, "Chris Thomasson"
    <> wrote:

    >"Chris Thomasson" <> wrote in message
    >news:...
    >> <> wrote in message
    >> news:...


    Suggestions for redirecting questions are ignored if you try to answer
    the question anyway. Let the questioner post in the proper forum and
    answer it there.

    --
    Al Balmer
    Sun City, AZ
     
    Al Balmer, Jan 11, 2008
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Scott Simpson
    Replies:
    8
    Views:
    1,097
    Stefan Ram
    Jan 13, 2006
  2. crichmon
    Replies:
    4
    Views:
    512
    Mabden
    Jul 7, 2004
  3. Tim Smith
    Replies:
    2
    Views:
    885
    Tim Smith
    Dec 15, 2004
  4. www
    Replies:
    10
    Views:
    469
  5. John
    Replies:
    0
    Views:
    632
Loading...

Share This Page