Mark
On Monday, June 25, 2012 4:12:43 AM UTC-4, Poyan Nabati wrote:
-- On Monday, June 25, 2012 4:12:43 AM UTC-4, Poyan Nabati wrote:
How should I implement this on the backend?
- Two models. I thought of having two models, Goal and Measurement, where Measurement has a corresponding field in the database called "value" that's agnostic of it's contents (in other words, a VARCHAR that I interpret differently depending on context). I believe, however, that this approach will create a lot of special code for each of the different cases down the line.
- Many models. Another way to do it would be to create NumericMeasurement, BooleanMeasurement etc etc for each of the different measurement-types. In Goal I could have a field that indicates the type and create the association Goal hasMany (each of the measurement types). Do you see any problems with this approach?
Is there another, better approach that I haven't thought about?
How would you solve this?
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
No comments:
Post a Comment