Components should not have to re-calculate the same result
In this case, PHP code connecting to the database (circa PHP3 API) for every request to calculated the link URL and link text for a link to the top level page for the category the current story is in. This is an example of what not to do and yet surprisingly, practices like this are prevalent!

In fact, content management systems that are in-process with the content delivery systems encourage this sort of thing. The maintenance eliminated by removing the hard coded category name is payed for in performance problems.

Reducing the maintenance is good, but this is the wrong way to acheive it.

Slide 18 of 37 Contents
  1 |   2 |   3 |   4 |   5 |   6 |   7 |   8 |   9 | 10
11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20
21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30
31 | 32 | 33 | 34 | 35 | 36 | 37
www.arachna.com > Educational Resources > Conference Presentations

spidaman
© 2000-2008 Ian Kallen | Copyright Notice