Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneral TopicsLow CarbWeightWatchers
WeightAdviser.com
Contact UsLink To UsSearch & Site Map

Weight Loss Forum / General Topics / August 2004

Tip: Looking for answers? Try searching our database.

advice regarding diet/nutrition software

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mark C - 21 Aug 2004 15:26 GMT
Hi all

I'm writing some diet/nutrition tracking software and would appreciate your
thoughts on something.  I'll keep it brief and get straight to the point.

The software maintains a database of foods which users can add to their
daily food log.  There's one of two ways I can program the 'adding' part:

- store a reference to the food and when the user needs to check the foods
eaten on a certain day, I can use the reference to look up the foods values
from the food database.  With this method, if the user edits the food
details (name, nutritional info, serving size etc) the details are also
updated in the food log because the info was never stored, just a reference
to it.

- copy all the information i need from the foods database into the food log
database, thereby having an independant copy. If the details for the
original food are changed, the details in the food log are preserved - they
don't change.

The advantage of using the first method is I can pull all kinds of useful
statistics, e.g. 'show me how many times I ate food x between date a and
date b' .  The disadvantage is the food needs to stay in the food database
for as long as you want it to appear in your foods logs.. deleteing the food
deletes it from the logs too.

I'm more inclined to use the first method, simply because I don't see the
harm in having a food stored in the food database indefinitly.  Each food
takes up only a tiny amount of space.

I'm looking more for usability rather than technical opinions.  If you use
diet or nutrition software, how does it handle deleteing foods.. are the
foods also purged from your food logs?  What seems to be the more
intuitive/natural behaviour?

any thoughts and input would be much appreciated
mark
Ignoramus15381 - 21 Aug 2004 14:48 GMT
> Hi all
>
[quoted text clipped - 10 lines]
> updated in the food log because the info was never stored, just a reference
> to it.

that's the way to go, definitely. Your food values database is the
"dictionary".

You might want to, one day, expand the dictionary by entering more
data about foods. This way, your food logs will all be instantly
enhanced.

Plus, a reference to the row in the food values table would be only
4-8 bytes, much less thana  copy of the information.

> - copy all the information i need from the foods database into the food log
> database, thereby having an independant copy. If the details for the
[quoted text clipped - 6 lines]
> for as long as you want it to appear in your foods logs.. deleteing the food
> deletes it from the logs too.

Well, why would you delete data from your dictionary table? I see no
reason for it.

> I'm more inclined to use the first method, simply because I don't see the
> harm in having a food stored in the food database indefinitly.  Each food
> takes up only a tiny amount of space.

That's one of the principles of database normalization.

> I'm looking more for usability rather than technical opinions.  If you use
> diet or nutrition software, how does it handle deleteing foods.. are the
> foods also purged from your food logs?  What seems to be the more
> intuitive/natural behaviour?
>
> any thoughts and input would be much appreciated

I would expect to not delete food descriptions. I think that the USDA
database already comes with unique keys generated for the entries, so
that the next release of their database would make it possible to
update dictionary entries rather than recreate the dictionary.

i
MU - 21 Aug 2004 22:43 GMT
> I'm writing some diet/nutrition tracking software

What code?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2012 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.