Skip to content

Instantly share code, notes, and snippets.

@pawelpluta
Created December 20, 2020 11:14
Show Gist options
  • Save pawelpluta/1337ed260cf7f7cf19720093da3801bb to your computer and use it in GitHub Desktop.
Save pawelpluta/1337ed260cf7f7cf19720093da3801bb to your computer and use it in GitHub Desktop.
Article: Law of Demeter - shameless assignment
class Team {
private Member manager;
private List<Member> members;
List<Member> getMembers() {
return members;
}
String managerName() {
Contact contact = manager.getContact();
PersonalData personalData = contact.getPersonalData();
return String.format("%s %s", personalData.getName(), personalData.getSurname());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment