I was the technical editor of this book; Now I have a copy right in front of me. My copy says:
class Client : SubjectAccessor { static void Main() { Console.WriteLine("Proxy Pattern\n"); ISubject subject = new Proxy(); Console.WriteLine(subject.Request()); Console.WriteLine(subject.Request()); ProtectionProxy subject = new ProtectionProxy(); Console.WriteLine(subject.Request());
Now there is a mistake; the subject variable has been declared twice. Apparently, I did not catch the error when I looked at the book. (The right thing here is to remove the type from the second "subject" declaration).
However, this is not the error you are reporting.
Are you sure this is not what your copy says? I have a release in December 2007; which edition do you have? Perhaps someone tried to fix this error in a later release and messed it up? I assume that someone tried to fix the error by removing both mentions of type ProtectionProxy from the error string, and not deleting the first.
source share