[nycphp-talk] Cake PHP and "Active Records"
Jon Baer
jonbaer at jonbaer.com
Thu Sep 28 23:25:21 EDT 2006
I think the one slick point that gets missed w/ Cake is the fact that
you can effectively bind and unbind your associations @ any time and
in any way you wish (paying attention to the default association sql
query it uses) ... this is a bit more advanced topic but basically
your right + RoR can do it because the entire language is dynamic @
runtime ...
Im still learning about this more but there is definitely a step @
the end of your application Id call "Tweaking and Optimizing your
Models" which is pretty absent right now.
Out of the box its a very basic structure but much like you would
have a DBA tune a Stored Proc, you would/could do the same to Cake
models. From what Nate said is that it will be made an easier
process in 1.2 ...
The 'passive record' idea sounds pretty interesting + I think you
would be able to do something like this w/ a behavior + beforeFind()
hooks.
Also the Set::map($model) stuff should help w/ doing the same __get()
__set() magic on your own models. Im pretty sure it will be a useful
item all around.
- Jon
On Sep 28, 2006, at 10:14 PM, Paul Houle wrote:
> My feeling about this is that I can't accept an "Active Record"
> implementation that (sometimes) uses the database in an outrageously
> inefficient way. I might trade a factor of 2 for convenience, but
> you
> can certainly get into situations where the RoR way and the PHPCake
> way
> could cost you a factor of 10 or more. I have to admit that I really
> don't know the answer.
More information about the talk
mailing list