Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2014
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.51 KB | None | 0 0
  1. public interface DataService {
  2. InsuranceClaim[] FindClaims(Customer customer);
  3. }
  4. public class Repository {
  5. public DataService InnerService { get; set; }
  6. }
  7. public class ClassThatNeedsInsuranceClaim {
  8. private Repository _repository;
  9. public ClassThatNeedsInsuranceClaim(Repository repository) {
  10. _repository = repository;
  11. }
  12. public void TallyAllTheOutstandingClaims(Customer customer) {
  13. // This line of code violates the Law of Demeter
  14. InsuranceClaim[] claims =
  15. _repository.InnerService.FindClaims(customer);
  16. }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement