Design pattern: Observer #38
stephaniesaab
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
An opportunity for a design pattern is to include an 'observer' design pattern in the 'Item' class. All items can watch for a change in the User's points and then once the User's points reaches a certain amount they will change from locked to unlocked. This will also make the lock/unlock method more secure because it will be able to work as a private method, so that not any class can go around changing its private attributes.
Beta Was this translation helpful? Give feedback.
All reactions