Identifying the common functionalities
In this section, let’s look at a graphical representation that shows the list of functions to be performed at each counter and the common functionalities between all four of them as follows. The common functionalities are highlighted in bold font in the following figure:
Figure 8.5 – Common operations performed across each counter
From Figure 8.5, all the functions highlighted in the bold font are common across all four counters. The review_items
function is common across the less than 10 items counter, greater than 10 items counter, and electronics counter. The count_items
function is common across the less than 10 items counter and greater than 10 items counter. The apply_coupon
function is common across the greater than 10 items counter and the electronics counter. Since there are common functions or operations performed across all of the counters, we can look at creating a common way of designing them...