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

Refactor: Implement Observer pattern #50

Closed
hantoine opened this issue Oct 12, 2018 · 4 comments
Closed

Refactor: Implement Observer pattern #50

hantoine opened this issue Oct 12, 2018 · 4 comments
Labels
Milestone

Comments

@hantoine
Copy link
Owner

hantoine commented Oct 12, 2018

After the lecture on MVC, I realized in MVC the controlleur is not the one asking the view to update itself.

In the future we will have to use the observer pattern, I suggest we fix our MVC by already using the observer pattern. The changes to make would actually not be that broad, just make RiskView implements observer interface and make the view call updateView on itself whenever it receives a notification from the RiskModel. This would require RiskView to have a reference to RiskModel that we thought was not something to do.

I could take care of this.

@hantoine
Copy link
Owner Author

I think the Gamecontroller Method might be better in a GameModel class, but this could be done after the build 1.

@hantoine
Copy link
Owner Author

Actually I'm not sure anymore lol. The teacher answered to my question that if the controller updates the view then it is not MVC, but on the slide 7 of MVC slides:
"the controller may also be responsible for updating the view"

@hantoine
Copy link
Owner Author

hantoine commented Oct 12, 2018

So I came to the teacher to ask a more precise question, he said that wether this can be considered as MVC or not is subject to debate, some people might say yes, others might say no. He also said he will not remove marks about that.

So in the end I dont think we need to make this for the build1, we could do it in the build2 since we will have to implement the observer pattern anyway.

@hantoine hantoine added this to the Build2 milestone Oct 12, 2018
@hantoine hantoine changed the title Fix MVC Implement Observer pattern Oct 12, 2018
@hantoine hantoine changed the title Implement Observer pattern Refactor: Implement Observer pattern Oct 24, 2018
@hantoine
Copy link
Owner Author

Done by hantoine. To be merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant