- Moderated by:
- Support
-
- rank:
-
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 -
- rank:
-
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
