Skip to content

Instantly share code, notes, and snippets.

@pawelpluta

pawelpluta/Team.java Secret

Created Dec 20, 2020
Embed
What would you like to do?
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