Your Hotel class should already extend the Observable class: Hotel is our model and as such it will notify views when there are changes.
Add the setChanged and notifyObservers method invocations in the methods listed below; these are the only methods which will require the view to be made aware of a change in state. Note that the Object argument passed in the notifyObservers invocation will vary depending on the method:
createReservation-> invoke setChanged and notifyObservers(optionalReservation)
findCustomer-> invoke setChanged and notifyObservers(customer)
findReservations-> invoke setChanged and notifyObservers(List)
registerCustomer-> invoke setChanged and notifyObservers(customer)
updateCreditCard-> invoke setChanged and notifyObservers(customer)
Your Hotel class should already extend the Observable class: Hotel is our model and as such it will notify views when there are changes.
Add the setChanged and notifyObservers method invocations in the methods listed below; these are the only methods which will require the view to be made aware of a change in state. Note that the Object argument passed in the notifyObservers invocation will vary depending on the method:
createReservation-> invoke setChanged and notifyObservers(optionalReservation) findCustomer-> invoke setChanged and notifyObservers(customer) findReservations-> invoke setChanged and notifyObservers(List)
registerCustomer-> invoke setChanged and notifyObservers(customer)
updateCreditCard-> invoke setChanged and notifyObservers(customer)