This document discusses the visitor pattern. It begins with an example scenario of using the visitor pattern to find Lady Gaga fans among students, professors, and staff. It then discusses naive approaches that have problems and are not object-oriented. The document explains the elements of the visitor pattern solution, including how it separates the algorithm from the class structure. Finally, it provides an example of using the visitor pattern in compiler design with the Eclipse JDT and how the AspectJ compiler reuses elements from JDT. The key benefits are allowing new operations to be added without changing existing classes and making compilers extensible.