Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public interface DataService {
- InsuranceClaim[] FindClaims(Customer customer);
- }
- public class Repository {
- public DataService InnerService { get; set; }
- }
- public class ClassThatNeedsInsuranceClaim {
- private Repository _repository;
- public ClassThatNeedsInsuranceClaim(Repository repository) {
- _repository = repository;
- }
- public void TallyAllTheOutstandingClaims(Customer customer) {
- // This line of code violates the Law of Demeter
- InsuranceClaim[] claims =
- _repository.InnerService.FindClaims(customer);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement