Angelo Trozzo
Apr 8, 2022

--

It s a good article but I disagree on where an how you encapsulated the responsibilities. Order should not know how to calculate costs. You could have used a visitor patter for that for example. I used to use code like this but generally I try to avoid and move to a more functional approach. If you will like to make a 3 part of this article on how to represent this in a Functional way , I m sure will be a success. Still nice one.

--

--

Angelo Trozzo
Angelo Trozzo

Written by Angelo Trozzo

Software craftsman, interested in technology, art, Down hill Bike, nature and obviously my family.