-
Notifications
You must be signed in to change notification settings - Fork 12
Description
Hi developers
I was looking through your code and found some SOLID principles that were being violated, here are my suggestions on how to fix it:
In Cloud.java, the interface had too many responsibilities, so it's better if you separate each responsibility in one interface on its own:
public interface Loggin { public boolean login(String userName, String password); }
public interface Upload { public void upload(String file); }
public interface Download { public String download(String file); }
Leaving Cloud just handeling the files, like this:
public interface Cloud { public void listFiles(); }
Now in Fly.java, interface that implements Bird, the main issue is Penguin causing the method fly() throw an error, since penguins cannot fly, instead I suggest the next model:
And finally in CaoCloaud.java you're using a direct object of CloudImp, taking advantage of the interfaces i suggested to creat in the problem with Cloud, we can fix it using your own class AbstractClouad.java and the interfaces, adding a new interface for FastDownload, something like this:
That would be all, thanks for reading and I hope this helps a little :)

