Computer Science 491/492
Senior Seminar
Dickinson College
Academic Year 2011/12
Grant Braught
The Proxy Pattern
Reading Assignment 
- The Pragmatic Programmer: Chapter 7
- Head First Design Patterns: Chapter 11
Discussion Questions 
The Pragmatic Programmer:
- p. 203: What is the difference between a policy statement and a requirement? How should they be treated differently?
- p. 205: What is a use case?
- p. 208: What are the dangers of over specifying?
- p. 209: Where does the section header "Just One More Wafer-Thin Mind..." come from? What the world does it have to do with software development?
- p. 211: #42.
- p. 213: Can you solve the problem w/o looking at the solution?
- p. 216: What is fear-of-starting syndrome? What two things can cause it? Have you ever experienced it? How have you dealt with it?
- p. 217: Read the quote 2 or 3 times, shake your head each time, then laugh out loud!
- p. 218: Half way down is a quote that starts "Look at that..." Compare this sentiment with the Extreme Programming principle known as YAGNI (look it up!)
Head First Design Patterns: (Questions by Philip and Adam)
- Do we want to make our remote calls from the Proxy to be transparent? If not, what would you suggest doing?
- Can you foresee any problems if we're relying on the Internet or a network to pass our information?
- What is IIOP?
- What are the differences between the Decorator and Proxy Patterns?
- Why would we want to separate the request from the method calls?
Hands-On 
(Activity by Philip and Adam)
- Update the PatternExamples project in Eclipse and go to the patterns.proxy package.
- Examine the Employee, EmployeeImpl, and EmployeeFindingTestDrive classes.
- Use the Proxy pattern to create two Invocation handlers, one for Employees, which can get any information and set all information besides PerformanceRating, and one for Employers, which can get any information but only alter the PerformanceRating.
- Create the two methods which create proxies in the EmployeeTestDrive class, and implement the drive method to test the proxies.