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 Creational Pattern: Singleton #19

Open
myortega opened this issue Jan 2, 2021 · 0 comments
Open

Implement Creational Pattern: Singleton #19

myortega opened this issue Jan 2, 2021 · 0 comments

Comments

@myortega
Copy link

myortega commented Jan 2, 2021

Hi, I noticed another issue that can be solved with the use of a pattern. The thing is that for your program you just need one instance of the hotel, having multiple instance can end in a disaster for booking, etc. So the suggestion is simple, keep all your variables in the class Hotel static and private (you already have them static), but also create a new variable for storing the singleton instance, and create a new public method for getting this instance. I hope this helps you :) .

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