New topic: 

To Store or Not to Store Hierarchical Paths in Database

<http://forums.realsoftware.com/viewtopic.php?t=45863>

         Page 1 of 1
   [ 1 post ]                 Previous topic | Next topic          Author  
Message        moe          Post subject: To Store or Not to Store Hierarchical 
Paths in DatabasePosted: Sat Nov 10, 2012 5:38 pm                         
Joined: Mon Nov 24, 2008 12:25 am
Posts: 155                Hi,

I have a question about whether or not to store paths of hierarchical data into 
the database.

For each widget record in my database, the user will be able to have a maximum 
of 4 possible categories ( a minimum of 1 ).  Each category is shown as a 
hierarchal path until the terminal category.  Each category, children 
categories and terminal category consists of an ID and a Name.

I'm storing my hierarchical data in the database in a way so that I can 
retrieve it using a modified preorder tree traversal.  It is explained at: 
http://www.sitepoint.com/hierarchical-data-database-2/  

I need to be able to retrieve the complete tree and display it when a user 
clicks on a widget. Using a modified preorder tree traversal, it's pretty quick 
for me to build the tree using code.  At this moment, after traversing the tree 
in code, I store the category Names and IDs in arrays.  However, I was 
wondering if there is any benefit of storing the tree path in the database 
instead?  I feel like maybe a class of nodes would be beneficial here?

Many Thanks!   
                             Top             Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 1 post ]      
-- 
Over 1500 classes with 29000 functions in one REALbasic plug-in collection. 
The Monkeybread Software Realbasic Plugin v9.3. 
http://www.monkeybreadsoftware.de/realbasic/plugins.shtml

[email protected]

Reply via email to