Computer Science 491/492
Senior Seminar

Dickinson College
Academic Year 2011/12
Grant Braught

The Proxy Pattern

Reading Assignment

Discussion Questions

Hands-On

(Activity by Philip and Adam)
  1. Update the PatternExamples project in Eclipse and go to the patterns.proxy package.
  2. Examine the Employee, EmployeeImpl, and EmployeeFindingTestDrive classes.
  3. 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.
  4. Create the two methods which create proxies in the EmployeeTestDrive class, and implement the drive method to test the proxies.