[Tutor] Dynamically naming functions
Alan Gauld
alan.gauld at freenet.co.uk
Mon Mar 13 18:38:09 CET 2006
> For website, I can't really see how I can not have a dynamic
> structure. There's no way I'm writing a function for each "folder".
Hmm, this may be a CherryPie concept thing but the vast majority
of websites do not have dynamic structures. It really shouldn't be
necessary. Why would you need to write a function per folder,
simply write one function that takes the folder as an argument.
> I do take your point though, however you often find that it's easy to
> maintain something dynamic than huge amounts of more static stuff
Very rarely, its easy to do backups of huge amounts of data if you
know where to find it, its hard to trawl all over a changing structure
looking for the things that need backing up. Particularly if, when you
try to restore it, it needs to go in a different place to where you found
it!
> in the difference between hundreds of static web pages and using
> a cms of some kind).
Yes but a CMS normally uses a static structure with dynamic content.
The templates stored in one place and the content in another. The
templates know where to look for the content and the content doesn't
care where the templates are.
Dynamic content is 'A Good Thing', dynamic structure is usually bad.
BTW On the concept of loading your entire site at startup; if you are
sharing a server you will make yourself very unpopular since you will
be a huge resource hog. That's why ASP, JSP and other frameworks
go to a lot of trouble to manage session lengths etc - to free up any
unused resources and keep server speed up. Loading the structure
of the site in the form of links might be reasonable, but only load content
when you absolutely must. This also helps the maintainers update the
site without restarting it.
Alan G.
More information about the Tutor
mailing list