Created
          August 18, 2020 09:44 
        
      - 
      
- 
        Save alibenmessaoud/020a6eb1ae9136f0d6d7c890337a1a7c to your computer and use it in GitHub Desktop. 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | 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