|
Posted by Michael Fesser on 01/08/08 14:20
..oO(Steve)
>"Michael Fesser" <netizen@gmx.de> wrote in message
>news:a676o3tif3o2rsja45dlc10dphncslb24m@4ax.com...
>>
>> I find it quite useful. In my own framework for example I have a class
>> TSitemap that holds a representation of all the documents on a website.
>> It contains a tree-like structure of simple page objects, which store
>> the name, title, URL path, description, access permissions etc. for
>> nearly every page. This sitemap is mainly used to automatically generate
>> nav bars (main menu, sub menus, breadcrumbs etc.) and such things, but
>> from time to time it's also necessary to directly access a particular
>> page object from the tree or to iterate over all pages, regardless of
>> their relation to other pages. To achieve this I simply implement the
>> ArrayAccess and Iterator interfaces in the TSitemap class.
>
>hmmm...hadn't thought of doing that. do you build that from a db each time a
>page is visited or do you build it once and then put it into a session?
Currently it's rebuilt on every request. Some parts of the sitemap come
from a DB to serve the rather static pages (their content is stored in
flat files on disk and just put into a global page template when the
page is requested), other parts are added by some components of the
framework. My 'admin' module for example adds its own section to the
sitemap as the entry point for all the admin components and plugins.
If this should become a bottleneck one day, then I might implement some
kind of caching, but currently the performance is OK. The bottlenecks
are somewhere else.
Micha
Navigation:
[Reply to this message]
|