Re: Help with project design

2007-07-31 Thread housebolt

I can't get too specific since I don't know all of the details
involved, but here's what I do know,

You'll want to create models for ALL of your tables. The reason behind
this is the nature of ActiveRecord, which is the main structure for
data abstraction in Cake. You use activerecord in cake to make your
table elements into PHP objects that you can easily manipulate. That's
part of what makes cake is so great (and why Ruby on Rails became so
popular).

However, I know that you're probably dealing with a lot of data,
seeing as your dealing with scientific species data. This is where
you're getting more into database design and less CakePHP. I
personally think it would be easier for you to make a table with all
of the kingdoms and then recursively link all of the data by $hasMany
and $belongsTo in each model you create (e.g. order.php, genus.php).

I also know that you don't have to create controllers for everything.
Use of $this-render(), $this-renderElement(), and $this-
requestAction() can do a ton to make your code reusable.

I know I'm probably not much help, but I believe Cake can get the job
done for you and come out with flying colors.

On Jul 30, 10:30 am, nagarjuna [EMAIL PROTECTED] wrote:
 Hello,

 I am designing a database to hold scientific observations of animals
 in the field. The database will be used for several different
 projects.  The basic unit for all projects is the observation, and
 observations across projects will store the same basic information
 (and use the same logic), but projects may also need to store some
 additional information.  My plan is to have one main observations
 table/model/controller, and then additional project specific tables.
 Each project then hasMany observations and each observation belongsTo
 one project, and in the observation view I will then find the
 appropriate project specific table and adjust my forms/displays
 appropriately.

 Any thoughts or critiques of this approach?

 Secondly, I need to store a hierarchical species taxonomy (kingdom,
 order, genus, etc) in the database and allow users to update it
 (species classifications are changed frequently).  The logic and view
 for each level is nearly identical, and I would like to avoid creating
 separate models and controllers for each. The best approach for me
 would be to dynamically change the table used by a model.  My search
 suggests that this is not possible, but does anyone know for sure?  I
 could also create a new class and inherit from it, but this would
 still involve creating a separate model and controller file for each
 level, which is less than ideal.  Any suggestions?

 Thanks


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---



Help with project design

2007-07-30 Thread nagarjuna

Hello,

I am designing a database to hold scientific observations of animals
in the field. The database will be used for several different
projects.  The basic unit for all projects is the observation, and
observations across projects will store the same basic information
(and use the same logic), but projects may also need to store some
additional information.  My plan is to have one main observations
table/model/controller, and then additional project specific tables.
Each project then hasMany observations and each observation belongsTo
one project, and in the observation view I will then find the
appropriate project specific table and adjust my forms/displays
appropriately.

Any thoughts or critiques of this approach?

Secondly, I need to store a hierarchical species taxonomy (kingdom,
order, genus, etc) in the database and allow users to update it
(species classifications are changed frequently).  The logic and view
for each level is nearly identical, and I would like to avoid creating
separate models and controllers for each. The best approach for me
would be to dynamically change the table used by a model.  My search
suggests that this is not possible, but does anyone know for sure?  I
could also create a new class and inherit from it, but this would
still involve creating a separate model and controller file for each
level, which is less than ideal.  Any suggestions?

Thanks


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---