Create a gist now

Instantly share code, notes, and snippets.

anonymous /MyService.java
Created Oct 28, 2011

Embed
What would you like to do?
public class MyService {
private Repository repository;
public MyService(Repository repository) {
Validate.notNull(repository);
this.repository = repository;
}
public void myMethod(long id) {
//get the object from the repository
Rule rule = this.repository.getRule(id);
rule.execute();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment