Skip to content

5.0 step1 correction

Jean Cavallo edited this page Jan 18, 2019 · 1 revision

Step 1 - Homework correction

Naming the models

You have 4 more models. Their __name__ should be:

  • library.genre
  • library.editor
  • library.book
  • library.book.exemplary

You may have used library.author.book. This is a valid choice, however a Book is an important enough entity in a library to justify breaking the link. Also, a book may have multiple authors (though we will not implement it this way).

The same is true for library.editor.author, but this would be more considered an error since the editor is linked to a book rather than an author.

Ordering the definitions

The most logical order would be:

  • Genre
  • Editor
  • Author
  • Book
  • Exemplary

The rationale is the following:

  • Genres are a finite set with few possible values, and very few informations. It is logical to see it as a configuration object
  • Editors are a little more complex (they may disappear, new ones may be created, etc...) but they are still few, so they are what we would call "soft configuration" because they are modified, but not so often
  • Authors are basic data in a library, as are books. But since a book "have" an author, we consider that a book is more specific than an author, and so should be defined after them
  • Exemplaries are physical implementation of the books. Books are abstract and exemplaries are real. Also, a book may have multiple exemplaries. So logically an exemplary comes after a book
Clone this wiki locally