I have an interface DBOperations which has all the public methods of Data class. This interface is implemented by two classes for local and remote modes. The client has an instance variable of type DBOperations so that it does not need to know whether the database is local or remote. Now, my question is, is it better to leave DBOperations as an interface or to change it to abstract class? What difference it makes if it is interface and if it is an abstract class? Thanks in advance for the help.
posted 15 years ago
I would recommend in interface in cases where you aren't implementing any of the methods in the abstract class. This is because you can always implement multiple interfaces, but are limited to one extend. Good luck