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:
- Given the above scenario, do you have a recommendation on which module to use? On what do you base this recommendation - experience, history, support ...
- Please provide links to any examples or projects of which you are aware from which I can learn.
Thank you in advance,
lbe
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.