Hi,

> I suggest to refactor findOne signatures. Or actually only the signature 
> w/out ellipsis. When we
> introduced the signature with elilpsis the cache argument was inevitably in 
> the middle. We kept the
> signature for the other method. I was caught recently by changing a method 
> call from ellipsis
> signature to the other. I introduced UtilMisc.toMap for the last argument 
> because I had 2 values and
> changed for one only, hence ellipsis could not be used. I did that in a 
> hurry, not thinking about
> the argument swap.
> 
> So it would be only a matter of swapping the cache argument from last place 
> to second in the old
> signature. IMO it makes sense to have "consistent" signatures... Maybe 
> findOne is not the only one
> to change...

Delegator.findList() also has the useCache param as the last one. So this is 
consistent with
findOne. The doCacheClear params also are always last.

The findOne with ellipsis is the only exception. I think that's OK.

As we write almost all our code in Groovy now, the findOne with ellipsis is not 
really necessary any
more for us. Groovy has a nice map literal syntax.

Martin

Reply via email to