Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Which Tree Module do you recommend

by learnedbyerror (Monk)
on Mar 31, 2016 at 18:18 UTC ( [id://1159214]=perlquestion: print w/replies, xml ) Need Help??

learnedbyerror has asked for the wisdom of the Perl Monks concerning the following question:

Oh Monks,

I again need your enlightened opinions. I am looking at using one of the n-ary tree modules (i.e. Tree, Tree::Simple, Forest ...) to model the relationship between two entities (Locations and Equipment) so that I can generate a generalized view to display the nested hierarchy as well as query parents, siblings and children.

Both entities are defined in a relational database.

The location records contain a parent location field.

The equipment records contain location and parent equipment fields, of which only one can be populated.

Some rules:

  • Location may be a child of a Location
  • Location has attributes
  • Equipment must be a child of a Location XOR an Equipment
  • Equipment has attributes

An example in reference syntax

LocationA = { Equipment1 => {}, LocationB => { Equipment2 => {}, Equipment3 => { Equipment4 => {}, Equipment5 => {}, }, }, LocationC => { LocationD => { Equipment6 => {}, Equipment7 => { Equipment8 => {}, Equipment9 => {}, }, }, }, }

My questions are:

  1. Given the above scenario, do you have a recommendation on which module to use? On what do you base this recommendation - experience, history, support ...
  2. Please provide links to any examples or projects of which you are aware from which I can learn.

Thank you in advance,

lbe

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1159214]
Approved by ww
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2024-04-18 00:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found