Hotel-Management-Project-Java
Hotel-Management-Project-Java copied to clipboard
Rooms store unnecesary values
In the following code there's a violation to the Single Responde Principle of SOLID design.
public class Singleroom implements Serializable{
String name;
String contact;
String gender;
ArrayList<Food> food =new ArrayList<>();`
class Doubleroom extends Singleroom implements Serializable
{
String name2;
String contact2;
String gender2;
The room stores the people that stay in the room, but doesn't need to store the personal info, there should be a new class of Guest that stores these values and the rooms only need to have this as their instance variable.
May i work on this issue?