Question: I have to implement a Client/Server architecture in Java, where the Server may change in the future (well, it definitely will at some point).

What would be the best way to take that possible change into account? Here's what I thought of:

1.) Create an interface for the Server:

```
public interface AlarmService {
  ...
}

```

2.) Create a concrete implementation:

```
public AlarmServiceImpl implements AlarmService {
  ...
}

```

3.) Write a static factory to get some sort of implementation

```
public AlarmServiceFactory {
  private AlarmService AlarmServiceFactory() {
    return new AlarmServiceImpl();
  }
}

```

Is this a good idea? Or is this too much? Or maybe I shouldn't take that change into account?

Answer: 
Consider [Business Delegate](http://java.sun.com/blueprints/corej2eepatterns/Patterns/BusinessDelegate.html) pattern. It's more powerful than just interface/implementation suggested already.
the question is not cent percent clear to me . but i think that you want to make your server flexible so that you can easily change the server without changing other parts. am i right? if yes then i think you should take a look over IOC pattern. 

regards
arefin.