Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Panda level #19

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Panda level #19

wants to merge 6 commits into from

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