Reply to Re: [PHP] Recursion: Ugh!

Your name:

Reply:


Posted by Steve Brown on 05/28/05 00:16

** email gagging, sorry if this is a DP **

On 5/27/05, Chris W. Parker <cparker@swatgear.com> wrote:
> Let's say you're entering a new product, you'd want to see a list of all
> the available categories, not just the last node of a branch.

Not neccesarily; it depends on how big your tree structure is. If you
only have 10 "categories" where an item could be placed, a list of all
available "categories" might be an OK solution. However, if you have
100 "categories," listing all of them is impractical. Even if you
only have 10 categories, you should plan for the day when you will
have >10 categories.

In our store (>500 categories), you add a new item by adding a child
to the current item. Usually we know which category we want to place
the item in before we begin to lay it up (if we don't, we can move an
item at any time simply by changing the parent of the item). So in
your case, if you wanted to create a new item in the category "Round",
you would first have to navigate to Food > Vegetables > Round, then
create the new item. This may seem more complicated, but think about
how much time your users are going to spend scrolling through a list
of lots of categories compared to this approach.

> But I wouldn't be building the entire tree if I were only looking at a
> specific node.

That's the beauty of it! :) You don't need the entire tree if you are
working on a specific node. Look at it this way: you can only work on
one item at a time, right? If you are working on the item "Fruit,"
why do you care that the parent of "Long" is "Vegetables" or that
"Round" has two children, "Spikey" and "Smooth"?

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация