Just FYI: Hooks are actually implemented identically to what I showed. I am
personally coming to prefer the super approach simply because it's more
obvious what's going on, and if the internal implementation of hooks
changes, I'm less likely to get bit in the ass. That said, I prefer
before_filter in controllers, because there I *don't* want to know what's
going on. I want the framework to hook in at an appropriate location.
-- Yehuda

On Tue, Mar 10, 2009 at 9:56 AM, Rafael Rosa <[email protected]> wrote:

> As I commented before, from my point of view, using hooks is a cleaner way
> to do that: it's less intrusive in the sense that you're not changing the
> implementation of any methods, and more declarative, because the "before
> :save, :add_interested" is read as a business rule, it's more explicit.
> Another advantage is that you can add other rules without touching any code
> already written, which make it more stable, a kind of "open-closed
> principle".
>
> But, in the end, taste is the tie breaker :)
>
> Cheers,
> Rafael
> www.rafaelrosafu.com
>
> >
>


-- 
Yehuda Katz
Developer | Engine Yard
(ph) 718.877.1325

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"DataMapper" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/datamapper?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to