Thank you William Bartlett for reading the blog and leaving a comment. Of course there is so much to learn and that is why I am here :)

As others have explained, you have not really used the strategy pattern because the business logic for assigning an offer to a user is gone : If I understand you right, this logic is not gone. See this discussion

I am not sure that an Offer class should have the knowledge of a User . We should be able to create an Offer without the knowledge of User. The logic of assigning an offer to a User can live in User class/Another class.

Let me know what do you think.

Happy Learning!!

--

--

Senior Staff Engineer @freshworks. Ex-McKinsey/Microsoft/Slideshare/SAP, Tech Enthusiast, Passionate about India. Opinions are mine

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Abhinav Dhasmana

Senior Staff Engineer @freshworks. Ex-McKinsey/Microsoft/Slideshare/SAP, Tech Enthusiast, Passionate about India. Opinions are mine