Skip to content

Instantly share code, notes, and snippets.

@stolarczykt
Created January 25, 2020 06:36
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 stolarczykt/509e99b54dd14558dfd7eee7ad90c85a to your computer and use it in GitHub Desktop.
Save stolarczykt/509e99b54dd14558dfd7eee7ad90c85a to your computer and use it in GitHub Desktop.
Examples of stamp and data coupling
//Stamp coupling
public EmployeeAddress findAddressFor(EmployeeData employeeData) {
EmployeeAddress address = repository
.findByEmployeeId(employeeData.getId())
//method body
return address;
}
//Data coupling
public ZipCode findZipCodeFor(EmployeeId employeeId) {
EmployeeAddress address = repository
.findByEmployeeId(employeeId)
//method body
return address.getZipCode();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment