Skip to content

Conversation

@rubyyan
Copy link

@rubyyan rubyyan commented Jul 23, 2013

Panda level finished.

@jwo
Copy link
Member

jwo commented Jul 24, 2013

Excellent job with this, looks great and works.

I'm not sure I like having a class level instance variable for the movie to be able to say Movie.history. If you had an API, you probably would not like for it to grow memory each time it was used.

Instead, I would recommend creating a MovieHistory class that stories the values you wanted it to store. That way, your search remained just a search, while you can use that later to record a search.

@rubyyan
Copy link
Author

rubyyan commented Jul 24, 2013

I now use the MovieHistory class.

@jwo
Copy link
Member

jwo commented Jul 24, 2013

Cool --- I would move the calculations to the MovieHistory class as well --- you'll keep the collection, and the calculation, together.

This would also keep the "movie" class pretty dumb -- which is how I like my data classes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants