@Bravo, what are the differences that would go into each distinction?
Wouldn't it be better to keep everything stored in fewer tables (again, 
for searching), and classify each species using rules found in 
additional tables

btw, since this is a massive hierarchy, a version of the Nested Set 
model may be usable here (but I dunno if it would be good for the sheer 
number of entries you're proposing. that would be worth investigating). 
Nested Set is a different approach to categorizing data hierarchy

so, the examples you provided of lifeforms -> reptiles -> squamata -> 
lizards, etc, could be entirely contained in a single table using Nested 
Set, and it would be a simple matter for you to find all siblings, 
children, parents, and the complete path to a nested row of data

that's personally how I would handle it, as otherwise you may run into 
maintenance problems when it comes to updating the many models that your 
current proposal would require

btw, for your example, using Nested Sets, your table would be 
considered/named "lifeforms", and everything would be stored therein

if this data is likely to be changed/moved often, then another approach 
(to still use Nested Sets) is to keep your lifeform data in a table with 
no hierarchy references. each entry would simply have a unique id. then 
you could have a join table that would manage the unique ids using the 
Nested Set model. that way, if you're moving entries around often, 
there's less load on the larger table.

CakePHP 1.2 has built-in support for Nested Set trees, and differs 
slightly from typical Nested Set models (which usually just have 
uniqueid,lft,rght) by also including parentid, which allows for speedier 
data access at times.

if you'd like to discuss this further, lemme know. good luck :-)
-Jon L

Bravo_Kernel wrote:
> @Woodman:
> Thanks you for the suggestions, I will try to set up a test using a
> single Controller that dynamically calls the needed Model(s) and
> View(s) for editing the objects and see how things perform.
> 
> @Coder:
> Many thanks for the warning. You have a very good point about the
> number of tables that will be created and the effect it will have on
> searches and so on.
> However, because I know there will not be (many) duplicate columns I
> don't really see an alternative. If you do, please let me know.
> 
> 
> Thanks again,
>    Rob
> 
> 
> On 21 aug, 17:14, Angry Coder <[EMAIL PROTECTED]> wrote:
>> Hi Bravo,
>>
>> I am not sure if going the route you have chosen will actually save
>> you effort later, it might even cause some headaches.
>>
>> Won't each of these separate tables contain mostly the same columns?
>> And if you want to search across entire classes of animals won't all
>> of these tables cause more harm then good?
>>
>> As to answer your questions: (keeping in mind I am still new to
>> cakephp)
>>
>> 1. I don't think so but it might make it more complicated. You might
>> want to use some method of dynamically loading the models, if you plan
>> to have so many.
>>
>> 2. You should be able to reuse some views by specifying which to load
>> using:
>>
>> $this->render('name_of_template.thtml');
>>
>> within your controller functions.
>>
>> Cheers,
>>
>> Coder
>>
>> On Aug 21, 8:54 am, Bravo_Kernel <[EMAIL PROTECTED]> wrote:
>>
>>> Hi group,
>>> I am building an application to (theoretically) store characteristics
>>> for all existing lifeforms on this planet and need some conceptual
>>> pointers on the best approach for solving this with Cake.
>>> To keep things maintanable and extendible I am thinking of creating
>>> lots of Models (with different database tables) using class
>>> inheritance, for example:
>>> classLifeForms -> classReptiles -> classSquamata -> classLizards
>>> classLifeForms -> classReptiles -> classSquamata -> classSnakes
>>> classLifeForms -> classMammals -> etc.
>>> Assuming the Model approach is valid I will have to build hundreds of
>>> Models. Now for my questions:
>>> 1. Will this force me to build a different controller to handle adding/
>>> deleting/modifying each subclass or would it be possible to reuse a
>>> single controller?
>>> 2. Will this force me to build a different view for each subclass or
>>> is reusing an option here as well?
>>> Any feedback is highly appreciated.
>>>   TIA Bravo
> 
> 
> > 
> 

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

Reply via email to