Search code examples
facade

Facade Pattern, is this ok?


I have two servers that I will be connecting to from one client. For each server, I will be doing an ftp "put" and a "rm".

Should I build one facade, and have an interface like this:

void putFileOnServer1(String file)
void putFileOnServer2(String file)
void removeFromServer1(String file)
void removeFromServer2(String file)

And, should the facade handle all the establishing of the connections and disconnecting? If so, should it use a factory to do so?


Solution

  • You have two methods, PutFileOnServer and RemoveFromServer. Which server you are putting or removing from should be part of the abstraction.