Hi,
Can someone please explain why the “1” in the upper right is not “1…*”?
It’s from here: Django Tutorial Part 3: Using models - Learn web development | MDN
Thanks,
Hi,
Can someone please explain why the “1” in the upper right is not “1…*”?
Hello @Rafael_Green
i will answer that from UML prespective
it mean each book has only one author but each author can write many books
sorry if i miss understand anything as i do not know about django
hope it help and have a nice day
OK, thanks for your answer,
So can you please also explain what author: Author[1..*]
(second field in the Book box) means?
you welcome it say the same thing 1 here mean one author … linked to * many books
plus sign mean this filed is private
you can check this about uml it’s not complete one but it would help
https://www.tutorialspoint.com/uml/uml_basic_notations.htm
hope it help and have a nice day
the Author[1…*] is probably a mistake because the diagram in the Express module is different (in this article: Express Tutorial Part 3: Using a Database (with Mongoose) - Learn web development | MDN):
if the example mentioned that each book has only one author then you are right
am i understand you right ?
in both Django and Express modules LocalLibrary’s example, each book has exactly one author
then update the page with the image you posted and @chrisdavidmills will be notified about that change
so if we miss something he can revert the change just login there and update it
and have a nice day both of you
Thanks @justsomeone @Rafael_Green
Yes, the multiplicity specified inside the Book class on Django image is inconsistent with the multiplicity shown next to the Author class and all the rest of the code. I will fix it.
As @justsomeone says, the difference between 1 and 1…* is “exactly 1” and “one or more”. Of course in real life a book may have multiple authors; in the examples I sometimes simplify things to make it easy to demonstrate both 1:1 and 1:many relationships.
@Rafael_Green Thanks for your recent fixes/proposals for the examples. I’m going to be looking at the Django example again properly in the coming month - so any feedback is not being ignored, just not got to it yet. Keep it coming.
The Django and Express tutorials are very well written and it’s very enjoyable to read them