Skip to content

Instantly share code, notes, and snippets.

@pawelpluta
Created December 20, 2020 11:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pawelpluta/3543ee5b45e80877b32bdad705be9910 to your computer and use it in GitHub Desktop.
Save pawelpluta/3543ee5b45e80877b32bdad705be9910 to your computer and use it in GitHub Desktop.
Article: Law of Demeter - direct value return
class Team {
private Member manager;
private List<Member> members;
List<Member> getMembers() {
return members;
}
String managerMail() {
Contact contact = manager.getContact();
return contact.getMail();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment