To just expand on the earlier answer, you'd pass your search criteria into your singleton method. eg:
Code:
private SearchDao search;
public List search(String name) {
return dao.search(name);
}
As the method does not modify any object-level properties, there is no need to worry about threading issues. Your DAOs are almost always the same, and just delegate to a RDBMS which takes care of synchronisation.
On the other hand, this method would be a problem:
Code:
private Map bankAccounts = new MashMap();
public void deposit(Long accountNumber, float amount) {
((Account)bankAccounts.get(accountNumber)).deposit(amount);
}
Hope that clears it up for you.