I'm using Sitebricks with Guice to implement REST service and I have a set of methods like this:
@Get
@At("/:version/har/mostRecentEntry/assertResponseTimeWithin")
public Reply<?> doSomething(@Named("version") int version, Request<String> request) {
// Validation logic for request parameters ...
// Extracting parameters (converting url params to domain area objects)
// Actual business logic
}
Which leads to a lot of copy/pasted code.
I'm looking for some way to separate common validating & extracting data logic from request parameters. Probably I can use AOP to do it, but maybe there's easier way Sitebricks provides?