jbuda said the following on 10/14/2010 02:45 PM:
Hi Peter
Thanks for that excellent explanation, it's very helpful.
Your right in saying that I assumed the unique key would 'navigation'
and hence could not extract anything. However, I'm a little lost as to
how I get that key if Mach-ii computes it?
See below, but there is a reason why we haven't made it ultra simple to
talk to the cache directly inside a view -- especially when trying to
get cache data that was originally cached by the <cache> command. I
would recommend against asking for cached data via the caching API
directly in your view. It causes brittle architectures and strange
dependencies.
Or wound something like
this be much easier and straight forward to do in the listener, as I
have that working just fine at the moment.
1a. It would better for your event-handler to have a <notify> command
that calls a listener with caching for all of your views that require
this information.
OR
1b. If it you calling this with great frequency, creating a subroutine
with the <cache> command wrapped around the <notify> command works well.
This would similar to using the caching directly inside of your listener.
OR
2. Push the caching into the listener and manually manage that.
OR
3. Push the caching further into your model (like using the cache
instead of running a query). This can be done using UtilityConnector
and ColdSpring.
Ultimately in the end, the easiest option with the least configuration
are options 1a/b and they get more complex (but provide more
flexibility) with options 2 and 3. I would opt for the simpliest first
unless the situation warrants something else.
Best,
.Peter
--
You received this message because you are subscribed to Mach-II for CFML list.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/mach-ii-for-coldfusion?hl=en
***New URLs as of April 29th, 2010***
SVN: http://svn.mach-ii.com/machii/
Wiki / Documentation / Tickets: http://trac.mach-ii.com/machii/