@Nagarjuna and Jon: Nice feedback and funny enough I just ran into the tree-issue myself as well :)
Your suggestions for a unique id in the base table pointing to an external MPTT tree table for the hierarchy position is exactly what I am already using in a similar (non-Cake) project. I will be using that method here again because it is pretty error proof and scales perfectly without losing performance. My base class (large table) will contain all entries/nodes with the commonly shared meta information. Looking at my demo I think that an extra pointer in the base table to an external table holding the Model type (mammel, lizard, etc.) would complement things . By loading the corresponding Model at runtime I will get all the needed database fields through Cake's inheritance logic without the need to lookup tables for myself. I can clearly see the benefits in that: create a model once, never look back. This looks like the most OOP'ish solution to me. The problems with searching through the many tables is still there but perhaps Lucene could handle that. Once again, I have not been using Cake for too long so if this is not making any sense please let me know. Remember, I am looking for the Cake approach here. No need in holding on to my old structural thinking ;) Bravo On 21 aug, 19:20, Jon Langevin <[EMAIL PROTECTED]> wrote: > nagarjuna, looks like your suggestion is similar to the one I just sent > :-) Nice to see someone else thinking along a similar pattern > > nagarjuna wrote: > > I am working on a similar project and decided to use a taxonomic_unit > > as the basic element. I have one table taxonomic_units where all > > levels get stored, as well as the hierarchical relations between them. > > You should look into modified pre-order tree traversal (see > >http://www.sitepoint.com/article/hierarchical-data-database). Of > > course each level will have different additional characteristics > > besides just the taxonomic relationships, and I use separate tables to > > store these characteristics (i.e. kingdom_characteristics, > > phylum_characteristics, etc.). I have just one model and one > > controller for the taxonomic units and in my controller I go the > > relevant additonal table, extract the other details, and my views are > > set up generically to display the info. > > > I am not sure if this is the most cake like approach, but it makes > > maintenance easier even if the coding is a bit uglier (lots of switch > > statements for example). > > > Hope that helps. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---
