Find proxy

Report a typo

Which of the following is an example of the proxy pattern?

1. Interface Mail

interface Mail is
  method receive(message: String)

2. Class GmailSpamGuard

class GmailSpamGuard implements Mail is
  ...

  method receive(message) is
    ...
    if (message == spam)
      skip(message)
    else
      Gmail mail = new Gmail()
      mail.receive(message)

3. Class Gmail

class Gmail implements Mail is  
  method receive(message: String) is
    ...

4. Class MailWindow

class MailWindow is
  ...
  
  Mail gmail = new GmailSpamGuard()
  gmail.receive(message)
Select one option from the list
___

Create a free account to access the full topic