Login | Register
My pages Projects Community openCollabNet

Discussions > dev > Re: [propel-dev] Propel event handler

propel
Discussion topic

Back to topic list

Re: [propel-dev] Propel event handler

Reply

Author hlellelid
Full name Hans Lellelid
Date 2007-11-15 15:28:03 PST
Message Hi Ron,

<snip>
> Both table foo and bar have the saver handler for the onCreate and
> onSave event. I intent to implement the event / handler structure using
> the observer pattern, Propel objects being Observables and event
> handlers being Observers. The saver handler (observer) would be an
> example where the onCreate event registers the propel object with the
> handler and the onSave triggers save on all registered objects. This way
> you can save multiple objects with a single save() call, potentially
> this means you could tweak things so that you would add or update many
> objects in a single sql query.
> I know many of the things this will make possible are already possible
> by overriding functions in the propel classes. I do believe however,
> that this mechanism would prove to be very flexible and easier to
> maintain than implementations in propel classes (I still have a whole
> lot of classes where I need to change save(PDO $con = nul) to
> save(PropelPDO $con = null)).
> I'll be starting to build this shortly, anyone having suggestions,
> improvements, seeing upfront bottlenecks, just let me know and if I
> think it makes sense I'll try to do something useful with it ;)
>

Yeah, I think this is what Symfony is doing w/ Propel. I believe they
have extended the builder classes to wrap the various methods to fire
pre/post events. They call this "mixins" (I guess it's a bit AOP like).
  You may wish to start from their implementation. I'm open to us
including a version of this directly in Propel too (maybe ability to
enable/disable the code would be nice too). I think it's a useful idea.

Hans

« Previous message in topic | 2 of 19 | Next message in topic »

Messages

Show all messages in topic

Propel event handler Ron Rademaker <r dot rademaker at virtualbuilding dot nl> Ron Rademaker <r dot rademaker at virtualbuilding dot nl> 2007-11-15 02:45:32 PST
     Re: [propel-dev] Propel event handler hlellelid Hans Lellelid 2007-11-15 15:28:03 PST
         Re: [propel-dev] Propel event handler Ron Rademaker <r dot rademaker at virtualbuilding dot nl> Ron Rademaker <r dot rademaker at virtualbuilding dot nl> 2007-11-16 00:28:50 PST
             Re: [propel-dev] Propel event handler Bert-Jan <info at bert-jan dot com> Bert-Jan <info at bert-jan dot com> 2007-11-16 02:34:57 PST
             Re: [propel-dev] Propel event handler hlellelid Hans Lellelid 2007-11-16 04:02:10 PST
                 Re: [propel-dev] Propel event handler Ron Rademaker <r dot rademaker at virtualbuilding dot nl> Ron Rademaker <r dot rademaker at virtualbuilding dot nl> 2007-11-16 04:15:58 PST
                     Re: [propel-dev] Propel event handler hlellelid Hans Lellelid 2007-11-16 05:21:35 PST
                         Re: [propel-dev] Propel event handler Ron Rademaker <r dot rademaker at virtualbuilding dot nl> Ron Rademaker <r dot rademaker at virtualbuilding dot nl> 2007-11-16 05:58:30 PST
                             Re: [propel-dev] Propel event handler =?ISO-8859-1?Q?David_Z=FClke?= <dz at bitxtender dot com> =?ISO-8859-1?Q?David_Z=FClke?= <dz at bitxtender dot com> 2007-11-16 06:36:22 PST
                                 Re: [propel-dev] Propel event handler hlellelid Hans Lellelid 2007-11-16 06:44:57 PST
                                     Re: [propel-dev] Propel event handler =?ISO-8859-1?Q?David_Z=FClke?= <dz at bitxtender dot com> =?ISO-8859-1?Q?David_Z=FClke?= <dz at bitxtender dot com> 2007-11-16 07:22:12 PST
     Re: [propel-dev] Propel event handler Ron Rademaker <r dot rademaker at virtualbuilding dot nl> Ron Rademaker <r dot rademaker at virtualbuilding dot nl> 2008-05-05 07:16:33 PDT
         Re: [propel-dev] Propel event handler hlellelid Hans Lellelid 2008-05-05 09:53:00 PDT
             Re: [propel-dev] Propel event handler Ron Rademaker <r dot rademaker at virtualbuilding dot nl> Ron Rademaker <r dot rademaker at virtualbuilding dot nl> 2008-05-06 00:15:41 PDT
                 Re: [propel-dev] Propel event handler hlellelid Hans Lellelid 2008-05-06 06:39:12 PDT
                     Re: [propel-dev] Propel event handler Ron Rademaker <r dot rademaker at virtualbuilding dot nl> Ron Rademaker <r dot rademaker at virtualbuilding dot nl> 2008-05-06 06:47:08 PDT
                         Re: [propel-dev] Propel event handler hlellelid Hans Lellelid 2008-05-06 06:49:51 PDT
                             Re: [propel-dev] Propel event handler Ron Rademaker <r dot rademaker at virtualbuilding dot nl> Ron Rademaker <r dot rademaker at virtualbuilding dot nl> 2008-05-06 08:51:25 PDT
                                 Re: [propel-dev] Propel event handler hlellelid Hans Lellelid 2008-05-06 09:48:07 PDT
Messages per page: