[development] Eliminate hooks entirely in Drupal 6

Michael Favia michael at favias.org
Wed Jan 24 17:49:59 UTC 2007


Mark Fredrickson wrote:
>> My favourite part of this technique is that it should make Drupal much
>> more "deterministic" (?)... You can check your registered callbacks and
>> have a much clearer idea of what will happen on any given function call
>> instead of having to search through every single module and inc file to
>> find something that looks similar to an invoke_all hook call.
> 
> -1 on a readability. Sure, it takes a couple of days to pick up the
> hook concept, but now, I can pop open any text file and know exactly
> what functions are going to be called when. With a registry, I need to
> go ask Drupal when they will be called, return to the file, look up
> the function call I want (which is going to be named
> mymodules_silly_excuse_for_not_writing_hook_foo), ....
> 
> I remain skeptical of this plan. I welcome a patch and benchmarks, however.

I honestly had the same concern as you with regards to landing in a new
module and getting your feet wet quickly. With my passing understanding
of the proposal there doesnt actually seem to be a reason not to follow
a standard naming convention anyway is there?

This would seem to provide both the benefits of computational efficiency
AND the lower barrier to entry and ease of use that we are used to.

Worst case scenario, should we decide to ditch /any/ naming convention
the "map" as it were would exist in the proposed .registry file/function
for quick reference no? Much like we currently use and lookup present
menu items as drupal callbacks.

-- 
Michael Favia                   michael at favias.org
tel. 512.585.5650        http://michael.favias.org


More information about the development mailing list