exercises while writing this discovered that it can be very difficultand extremely educationalto come up with good examples where specific design patterns should be used instead of going over current or old projects to see where you can apply these patternsas 've suggested in previous think about the patterns and different situations where they might come up try to think outside your own experiences if your current projects are in the banking businessconsider how you' apply these design patterns in retail or point-of-sale application if you normally write web applicationsthink about using design patterns while writing compiler look at the decorator pattern and come up with some good examples of when to apply it focus on the pattern itselfnot the python syntax we discussedit' bit more general than the actual pattern the special syntax for decorators ishoweversomething you may want to look for places to apply in existing projects too what are some good areas to use the observer patternwhythink about not only how you' apply the patternbut how you would implement the same task without using observerwhat do you gainor loseby choosing to use itconsider the difference between the strategy and state patterns implementation-wisethey look very similaryet they have different purposes can you think of cases where the patterns could be interchangedwould it be reasonable to redesign state-based system to use strategy insteador vice versahow different would the design actually bethe template pattern is such an obvious application of inheritance to reduce duplicate code that you may have used it beforewithout knowing its name try to think of at least half dozen different scenarios where it would be useful if you can do thisyou'll be finding places for it in your daily coding all the time summary this discussed several common design patterns in detailwith examplesuml diagramsand discussion of the differences between python and statically typed object-oriented languages the decorator pattern is often implemented using python' more generic decorator syntax the observer pattern is useful way to decouple events from actions taken on those events the strategy pattern allows different algorithms to be chosen to accomplish the same task the state pattern looks similarbut is used instead to represent systems can move between different states using well-defined actions the singleton patternpopular in some statically typed languagesis almost always an anti-pattern in python in the next we'll wrap up our discussion of design patterns