0

I'm currently testing Parse and I faced to some issues / challenges. Assume that I have (its just for an example), on my phone, 3 screens:

  • one for the menu
  • one for recipes linked to the menu
  • one for the ingredients linked to the recipes

I'm wondering how to configure Parse database to have the link between the database/class: - having one class for all the menu, one class for all the recipes and one class with all the ingredients where there is a link between the menu, the linked recipes to it and the the linked ingredients to the recipes ?

I was thinking to a Pointer but I don't know how to link to specific database to display the right menu with the right recipes with the right ingredients.

Thank you

Regards

2
  • Sounds like a plan (though it's too broad as a question), try it out. Commented Jul 22, 2015 at 8:28
  • I take in account your remarks. Edit done Commented Jul 22, 2015 at 8:39

1 Answer 1

2

Look towards relationships instead of pointers. Pointers are 'to-one' where as relationships are 'to-many' and each of your classes has many associated others. I.e. 1 Menu has many Recipes, each Recipe has many Ingredients.

For your ingredients, consider also that you have an Ingredient, but you also have an amount of that ingredient. Ingredients can be reused across recipes (and you may want to do that so you can query all the recipes which include one or more ingredients), but amounts aren't really reusable. So, you may actually want an IngredientAmount class so your Recipe has a relationship to IngredientAmounts and each IngredientAmount has a pointer to the associated Ingredient.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.