RE: [SMARTY-DEV] feature request
| From: | Peter Billen | Date: | Mon, 05 Jan 2004 22:51:32 +0000 |
| Subject: | RE: [SMARTY-DEV] feature request | ||
| References: | 1 | Groups: | php.smarty.dev |
| Request: | Send a blank email to php-smarty-dev+get-2033@lists.php.net to get a copy of this message | ||
This was a very simple example, in which it may be tolerable to retrieve
'all possible information related to news items' and to do a lot of joins in
the sql queries. But what if a user asks for only one news item, do you also
retrieve the other news items because mostly there are more than one news
items showed on a site, so he will probably ask for more news items later
on? There may be so much situations where is not that easy to define whether
you retrieve everything or just a part of the requested data.
I believe on big sites, this won't work at all, because you have to take
care of so much situations and exceptions and caching on big sites is imho
really difficult. Yes I know I proposed this as a 'new way of using
templates', but the more I think about it, the more I believe it's a not a
good idea after all.
In general, how do you guys use smarty in your projects? Do you simple
define a set of 'possible sections in the site' (such as: section which
shows all news items, section which shows news item x + its comments,
section to add a comment to news item, etc) and for each section, you simply
assign the variables (mostly arrays?) related to that section? Or do you
guys do it on another way? Wherefore do you use the plugins? Do you have
special classes for trivial purposes? ...
I'd really like to know how you guys use smarty, in order to find out a good
way of using templates, since I'm still new with it. (anything is welcome:
your own experiences, tutorials, URLs of open source projects which use
smarty on a decent way, ...)
Kind regards,
Peter
-----Original Message-----
From: Mark Rogers [mailto:mark@quarella.co.uk]
Sent: maandag 5 januari 2004 19:43
To: 'Smarty Dev'
Cc: Peter Billen
Subject: Re: [SMARTY-DEV] feature request
> - Do you also query the author?
> - Do you also query the comments of the news item?
> - Do you ...
>
> If you answer yes on one of those questions, and it turns out the template
> doesn't need it after all: overhead, you queried too much (and a join is
> very expensive)
Depends how you look at it. Is it better to query all required data for news
(including any joins) when only part of it is needed, or to query it even
when none of it is needed?
This, to me, is clear cut! Particularly when you look at the
PostNuke/PHP-Nuke types of site, where there is the potential for all sorts
of information to be shown on any page but the likelihood that only parts of
it will be. I'd settle for pulling out all the news but none of the surveys,
calendars, "who's online", etc etc... Similarly shopping sites and news
sites and numerous other examples.
--
Mark Rogers,
More Solutions Ltd :: Tel: 0845 45 89 555
--
Smarty Development Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php