mardi 5 juillet 2016

Define an interface and pass arguments to implementations if needed

I have defined a generic interface as follows:

public interface DataHandler { 
   public ArrayList getMyData();  
}  

I am thinking that in some cases I would need to pass some params in order for the concrete implementations to work.
What is the best approach for this?
Make the interface like: public ArrayList getMyData(Object params); or
public ArrayList getMyData(Map<String, Object> params); or another way?

Aucun commentaire:

Enregistrer un commentaire