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

Implement Behavioral Pattern: Chain of Responsibility #18

Open
myortega opened this issue Dec 31, 2020 · 0 comments
Open

Implement Behavioral Pattern: Chain of Responsibility #18

myortega opened this issue Dec 31, 2020 · 0 comments

Comments

@myortega
Copy link

Hi, I was checking your code for a homework and I wanted to suggest you a better way to handle room types. As you can see in the title is the pattern Chain of Responsibility, using this pattern with the types of rooms will allow you to have a better organization of the code and in case it needs maintenance or to add a new feature/service it will be easier. The first thing you need to do is create an interface Room and then create different classes for each type of room, as a result you wont need to do a switch statement to look for the type of room, you will simply create an object of the type of room. Hope this can help you, thanks.

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

No branches or pull requests

1 participant