Titles and Genres As Concepts
During the lecture, one topic of discussion that came up was the relationship between movies and their genres and titles. Can a movie have multiple genres? Can it have multiple titles, one for each language? What happens when multiple movies have the same genre? These are all questions that we have to answer when creating the Movie concept.
Well, maybe not necessarily. I believe separating the Title and Genre as their own concepts solves all three problems and adds a lot of opportunities for improvement.
One possible way to do this would be to completely remove Genre and Title from Movie
concept Movie
purpose: info about all movies
state:
year: Movie -> one Year
remakeOf, sequelTo: Movie -> opt Movie
concept Movie
purpose: info about all movies
state:
year: Movie -> one Year
remakeOf, sequelTo: Movie -> opt Movie
And then we could have a plethora of options when implementing Genre and Title.
Genre
Maybe we believe movies only should have one genre.
concept Genre1[Movie]
state:
genre: Movie -> one String
concept Genre1[Movie]
state:
genre: Movie -> one String
or more than one
concept Genre2[Movie]
state:
genre: Movie -> set String
concept Genre2[Movie]
state:
genre: Movie -> set String
or we wanna allow subgenres as well
concept Genre3[Movie]
state:
genre: Movie -> set String
subgenre: Movie -> set String
concept Genre3[Movie]
state:
genre: Movie -> set String
subgenre: Movie -> set String
Separating the genre like this could allow for complex logic implemented in the actions as well. Maybe we could make our lookup actions smart enough that if a person looks up "Action Comedy" all movies that contain the genres "Action" and "Comedy" simultaneously pop up as well?
Title
A very smart Title implementation that supports multiple languages could be as follows
concept MultilingualTitle[Movie, Language]
state:
originalTitle: Movie -> one String
titleByLanguage: Movie, Language -> lone String
concept MultilingualTitle[Movie, Language]
state:
originalTitle: Movie -> one String
titleByLanguage: Movie, Language -> lone String
We could also provide smart logic so that the titleByLanguage is populated automatically when given the originalTitle.
Here is another idea, a Title concept that could differentiate between different titles using their production year: For example, it would automatically display the titles for Heat and Heat as Heat(1986) and Heat(1995).
Reusability
Another great upside to this approach would be to use all our great, smart Genre and Title concepts in other contexts as well: Books, music, etc... Just replacing Genre[Movie] with something more generic like Genre[Content] would suffice.