List Info

Thread: The new menu system




The new menu system
user name
2006-09-26 15:14:48
>>> so, lets create a new hook_signal($op) which
fires at various points 
>>> during a request. Initially, it replace
hook_init() and hook_exit() 
>>> with $op=precache, $op=postcache, and $op=exit.
We shall also add 
>>> $op=postbootstrap  which is where the
drupal_add_css calls will go.
> 
> This is an unneeded level of abstraction. We already
have signals that 
> fire at various points during a request. They are
called hooks. They are 
> faster and more descriptive than hook_signal($op).
> 
> hook_precache
> hook_postcache
> hook_exit

sure, thats a reasonable option ... i find it useful though
to distinguish 
between hooks that care about your return value and hooks
that don't. those 
that don't are candidates for grouping within a single
hook_signal($op). the 
principle advantage is cutting down on the number of hooks
... not a big 
deal though.

The new menu system
user name
2006-09-26 15:36:47
Moshe Weitzman wrote:
> sure, thats a reasonable option ... i find it useful
though to 
> distinguish between hooks that care about your return
value and hooks 
> that don't. those that don't are candidates for
grouping within a single 
> hook_signal($op). the principle advantage is cutting
down on the number 
> of hooks ... not a big deal though.

If there's one thing I've become convinced of after working
with 
NodeAPI, it's that multi-operation hooks are evil. In some
cases it 
makes sense -- providing an $op is a way to distinguish
between what 
triggered a given call to the function. But in many cases,
we use and 
abuse $op to squish many disparate functions into a
monster-function.

Separate hooks with clear meanings is a happy thing, IMO at
least.

--Jeff

The new menu system
user name
2006-09-26 18:32:14
On Tue, 26 Sep 2006, Moshe Weitzman wrote:
> sure, thats a reasonable option ... i find it useful
though to distinguish 
> between hooks that care about your return value and
hooks that don't. those 
> that don't are candidates for grouping within a single
hook_signal($op). the 
> principle advantage is cutting down on the number of
hooks ... not a big deal 
> though.

IMHO it is not considered to be an advantage if we add
another layer of 
indirection here.

Gabor
[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )