Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rooms store unnecesary values #3

Open
dsantistevan opened this issue Jul 12, 2020 · 1 comment
Open

Rooms store unnecesary values #3

dsantistevan opened this issue Jul 12, 2020 · 1 comment

Comments

@dsantistevan
Copy link

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
Copy link

May i work on this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants