shouryaj98 / Hotel-Management-Project-Java

It is a Hotel Management tool which can be used to manage activites like storing customer details, booking rooms of four different types, ordering food for particular rooms, unbooking rooms and showing the bill.
MIT License
335 stars 426 forks source link

Rooms store unnecesary values #3

Open dsantistevan opened 4 years ago

dsantistevan commented 4 years ago

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.

Rishi6229 commented 3 years ago

May i work on this issue?