Skip to content

Instantly share code, notes, and snippets.

@alibenmessaoud
Created August 18, 2020 09:44
Show Gist options
  • Save alibenmessaoud/020a6eb1ae9136f0d6d7c890337a1a7c to your computer and use it in GitHub Desktop.
Save alibenmessaoud/020a6eb1ae9136f0d6d7c890337a1a7c to your computer and use it in GitHub Desktop.
class LoyaltyCardService {
// constructor removed for brevity's sake
void addPoints(int id, int points) {
LoyaltyCard card = //... find card by id in db
card.addPoints(points);
// persist the LoyaltyCard
}
void removePoints(int id, int points) {
LoyaltyCard card = //... find card by id in db
card.removePoints(points)
// persist the LoyaltyCard
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment