Designing interfaces more effectively
Hi,
I'm having a requirement, where i need to design an interface. Currently we are having one concrete class which is going to implement that interface.
for ex :
publicinterface myintf
{
public Object getMyData(String name)throws NameNotFoundException, DataAccessException;
}
Here the interface throws two exceptions, NameNotFoundException and DataAccessException,
But i think this is a bad design, i know that the concrete class that i have now will interact with the database, thus may cause DataAccessException.
But it seems i am trying to inject dependancy from my concrete class to the interface, because may be other classes which is going to implement the same interface in future may not be hitting the db for getting the data.
Could you please tell me what and all i need to consider for exception clause while designing the interface.

