This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
What is the relationship between a Guest class and a Room class booked by a guest in a hotel.Is there a need of a in between Booking class.It is not any one like Has-a Or Is-a isn't it I think it is Gust Booked Room and the Booking class comes between the Guest class and the Room class as the linking class. Am I right?
A guest can, over time, have had multiple rooms. Every room will have had multiple guests. In other words, it is a many-to-many relation. In database design this is usually solved by a table to link the two, in this case the booking. Then you say a booking HAS-A guest and HAS-A room, and both a guest and a room HAVE-MULTIPLE (a form of HAS-A with arrays / collections) bookings.