template method pattern we have the same results with the test cases included in the main function as we had for the version using multiple if statements =========running stock sync between local and remote system retrieving remote stock items from system updating local items sending updates to third party system send transaction to system ({'items'[{'item_id' 'amount_purchased' 'value' }]'id' },=========running stock sync between local and remote system retrieving remote stock items from system updating local items sending updates to third party system send transaction to system ({'items'[{'item_id' 'amount_purchased' 'value' }]'id' },=========running stock sync between local and remote system retrieving remote stock items from system updating local items sending updates to third party system send transaction to system ({'items'[{'item_id' 'amount_purchased' 'value' }]'id' },two things bother me about this implementation the first is that the functions we are following are clearly steps in the same processandas suchthey should live in single entity instead of being scattered we also don' want to pass in strategy based on the system that is being targeted for every step of the wayas this is another violation of the dry principle insteadwhat we need to do is implement another design pattern called the template method pattern the template method does exactly what it says on the box it provides method template that can be followed to implement specific process step by stepand then that template can be used in many different scenarios by simply changing couple of details