observer pattern in the outputwe can see the relevant values added to the walletexperienceand badgeswith the right badge being awarded once the threshold is cleared wallet experience badges fun badgeearned [ bravery badgeunearned [ missing badgeunearned [ +++++++++++++++this very basic implementation has fairly complex set of calculations to perform whenever task is completed in the preceding codewe have fairly well-implemented architecturebut the evaluation function is still clunkyand ' sure you already get that feeling that this is code you would not like to work on once you got it working also think that it would not be any fun to write tests for this method any additions to the system would mean altering this methodforcing even more calculations and evaluations to take place as we stated earlierthis is symptom of having tightly coupled system the task object must know about every points object in order for it to be able to assign the correct points or credits to the correct sub-system we want to remove the evaluation of every rule from the main part of the task complete method and place more responsibility with the sub-systems so they handle data alterations based on their own rules and not those of some foresight object to do thiswe take the first step toward more decoupled systemas seen heretask_semi_decoupled py class task(object)def __init__(selfuser_type)self user user self _type _type def complete(self)self user complete_task(selfself user wallet complete_task(selffor badge in self user badgesbadge complete_task(self