Java – design problem: Reservation System
I have to design and implement a reservation system for the hotel I have
>Array list of reservation Objects > array list of room objects
I'd like to keep the room for a given date
It's easy to book a room without an appointment, but the date part complicates it I'm trying to design this and confidently nudge it in the right direction. I can code it
How do you say on this date, but you don't reserve a room on that date?
There is no database or anything, it's just an abstract reservation system
(I've been staring at this for a while, please forgive me if the solution is easy)
thank you.
Solution
Edit – second idea, why not have a reservation instance list for each room, and the reservation instance has a start / end attribute, which can tell you when the reservation occurs?
In this way, in order to judge whether a room is reserved for a period of time, you just need to cycle through the reservation to see if the time in question is within the start / end range of any reservation... It is not easy (nor difficult) to grant the code implementation, but this is a basic idea