RE: Storing dynamic attribute data in a db

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

 



On Thursday, January 18, 2007 5:09 PM Paul Novitski
<mailto:paul@xxxxxxxxxxxxxxxxxxx> said:

> Are you considering keeping all the levels of your data tree in a
> single table because you can't predict how many levels there will
> be?  If you CAN predict its depth, wouldn't it be simpler and easier
> to conceive, code, and debug with N tables chained in parent-child
> relationships?
> 
> I'm not asking rhetorically but seriously, for discussion.  How are
> you weighing the pros & cons of using MPTT?

Good question.

In my case it is not possible to determine the depth of each product's
attributes. We deal with many different manufacturers and they all set
their products up differently. Some have (maybe) one attribute while
others can have four or five. I wouldn't doubt that sometime in the
future I will see six or more.

Also, I personally prefer not to hard code values and to instead make
everything flexible. I've done that in the past and it kicks my butt
when requirements change and I have to go through and "fix" things. I
prefer a slightly higher learning curve in the beginning for greater
flexibility in the future.

Lastly, I don't know if you're familiar with MPTT but it's actually
quite easy to work with once you have a stable set of functions to
manipulate the tree. (I got mine from the Sitepoint article where I
learned about it a few years ago.)

Hope that answers your question.


Chris.

-- 
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