Zikula: A Flexible Open Source Content Management System
home | forum | contact us

Dizkus

Bottom
Clearing pnRender caches using hooks?
  • Posted: 10.05.2006, 08:01
     
    halversp
    rank:
    Freshman Freshman
    registered:
     May 2006
    Status:
    offline
    last visit:
    10.05.06
    Posts:
    3
    While working my way through the 0.762 Example module (assisted by Johnny Birchett's fabulous walk-through), I noticed there's code in the admin API functions to clear the appropriate pnRender cache after an item is updated or deleted. This seems to break the otherwise clean separation between GUI and API modules, as the cache is a presentation-layer (GUI) object. Wouldn't it be cleaner to clear the caches thru a corresponding hook function (item update, item delete)? That way the API stays "pure" of GUI coupling -- it just calls the hooks as it currently does, without any explicit reference to a rendering object. Anything I'm missing about hook functions?

    pch



    edited by: halversp, May 09, 2006 - 10:03 PM
  • Posted: 12.05.2006, 00:49
     
    rank:
    Moderator Moderator
    registered:
     March 2002
    Status:
    offline
    last visit:
    26.08.08
    Posts:
    7720
    While a hook function could be used this creates additional work. Say we put the caching clearing into the pnRender module as a hook. The pnRender module would need it's hooks activating for every module.

    IMO this doesn't really break the seperation since the API doesn't actually perform any real output just manages the cache.

    -Mark

Extensions Moderation

Main Menu

Extensions Database

Documentation

Development

Login

Donate to Zikula