Hi
I'm trying to build an elixir model in which I have a class with a list(of variable size) of tuples.
One example would be a recipe
while I can do something like this:
class Recipe(Entity):
ingrediants = OneToMany('IngrediantList')
cooking_time = Field(Integer)
...
class IngrediantList(Entity):
ingrediant = ManyToOne('Ingrediant')
quantity = Field(Number(3,2))
class Ingrediant(Entity):
name = Field(String(30))
...
It has a number of short comings. For one, I don't like creating an entity for ingrediant list which I don't have any meaning for wrt the domain; takes fun out of abstraction.
Another is that a query like which items can I prepare with this ingredient would get really messy and probably inefficient without adding more relations and or fields to the model making it messy in turn.
One more example would be a bank deposit slip with list of denominations and quantity.
What is the best way to design such a model?