Class Diagram at Example

Heyho,

I’ve got a question about my class diagram which I use to model a cookbook. For that I need the class “recipe” and the class “ingredients” with m:n multiplicity right? But what should I do with the amount of ingridents? This I think must have it’s position as attribute of the aggregation, but how to model it in the class diagram?

I hope you’ll understand my question :slight_smile:

Erik

Hi Erik,

Thanks for your post. You can add an Association class to the association between the class “recipe” and the class “ingredients”. Association Class is used for describing association by holding additional attributes which do not actually belong to the objects involved in the association.

You can get details of Association Class from http://resources.visual-paradigm.com/index.php/uml-faq/37-faq/54-add-assoc-class.html

If there is any further inquiry, please do not hesitate to contact me.

Best regards,
Lilian Wong