Re: Delegation vs Hooks (was: Annouce: DBIx::Class, a.k.a "taking the easy way out")

[prev] [thread] [next] [Date index for 2005/07/27]

From: Matt S Trout
Subject: Re: Delegation vs Hooks (was: Annouce: DBIx::Class, a.k.a "taking the easy way out")
Date: 00:54 on 27 Jul 2005
On Tue, Jul 26, 2005 at 08:39:09PM -0400, John Siracusa wrote:
> On 7/26/05 7:27 PM, Ask Bjørn Hansen wrote:
> > What's the difference between hooks and delegation?
> > 
> > Is it just the direction the relationship starts in (hooks = plugin
> > says "Application, I want to handle foo", delegation = application
> > says "plugin, you handle foo")?
> 
> With any language issue, there's ambiguity based on context.  That said, I'd
> differentiate those terms thusly:
> 
> Hooks: "When event X happens, call code Y"
> 
> Delegation: "When it comes time to do X, let Y handle it."
> 
> The distinction is that, in the "hook" case, responsibility is not entirely
> delegated (see? :) to another entity.  Rather, the other entity is simply
> given a chance to contribute to the process.  Delegation, OTOH, entirely
> passes responsibility for a certain task to another entity.

This is a far better explanation than mine was, but I don't think a
Supercedes: header is going to work on here :)

        -- 
             Matt S Trout           Website: http://www.shadowcatsystems.co.uk
  Technical Director        E-mail:  mst (at) shadowcatsystems.co.uk
Shadowcat Systems Ltd.

(message missing)

Delegation vs Hooks (was: Annouce: DBIx::Class, a.k.a "taking the easy way out")
=?ISO-8859-1?Q?Ask_Bj=F8rn_Hansen?= 23:27 on 26 Jul 2005

Re: Delegation vs Hooks (was: Annouce: DBIx::Class, a.k.a "taking the easy way out")
Matt S Trout 00:54 on 27 Jul 2005

Generated at 16:37 on 28 Jul 2005 by mariachi v0.52