Re: Recursion: Ugh!

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 5/27/05, Chris W. Parker <cparker@xxxxxxxxxxxx> 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"?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux