I'm having a hard time wrapping my head around something. I'm sure this is easier than I think, but I'm having a major mental block.
Let's say I have a "search" screen that allows a user to specify query criteria, like start and end date, project manager, city, state, etc. They can either leave the criteria wide open (wildcard) or specify values for a handful of fields.
Currently my Struts actions handle this by looking at the specified values and passing them down to DAO methods which have (far too) many input parameters. These in turn build Hibernate Query or Critera objects and throw them against the database. It works fine, but the DAO method signatures are ugly. And I don't want to use the Hibernate Criteria objects above the DAO layer, because then I'd tie my service layer to a specific DAO implementation (Hibernate).
How would you refactor this?
Thanks in advance,
Scott


Reply With Quote