Yeah, something like ThreadLocal helps stop api changes. I used it to put my PageRequest object into ThreadLocal so I wasn't passing pagination information through my layers api parameters. Instead the Controller layer would create the PageRequest object and put it into ThreadLocal. Then all the way down in my Repository layer I get the PageRequest out of ThreadLocal so I can pass it to my query
string. Well, I actually get it from ThreadLocal in my Service layer because I have no Repository code, just Repository interfaces because I am using Spring Data.
Mark