diff --git a/src/main/java/com/designpatterns/structural/proxy/Citizen.java b/src/main/java/com/designpatterns/structural/proxy/Citizen.java deleted file mode 100644 index 3f34e5f7..00000000 --- a/src/main/java/com/designpatterns/structural/proxy/Citizen.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.designpatterns.structural.proxy; - -import com.designpatterns.structural.proxy.president.PresidentSecretary; - -public class Citizen { - - public static void main(String[] args) { - PresidentSecretary presidentSecretary = new PresidentSecretary(); - presidentSecretary.leaveValidMessageForPresident("Hello president."); - } -} diff --git a/src/main/java/com/designpatterns/structural/proxy/president/President.java b/src/main/java/com/designpatterns/structural/proxy/president/President.java index 18d0e31c..50b712b4 100644 --- a/src/main/java/com/designpatterns/structural/proxy/president/President.java +++ b/src/main/java/com/designpatterns/structural/proxy/president/President.java @@ -22,6 +22,6 @@ public class President { void talkToThePresident(String message){ - System.out.println("I, the President, have received this message:" + message); + System.out.println("President: I have received the message:" + message); } } diff --git a/src/main/java/com/designpatterns/structural/proxy/president/PresidentSecretary.java b/src/main/java/com/designpatterns/structural/proxy/president/PresidentSecretary.java index fd90a0b0..fb951ed9 100644 --- a/src/main/java/com/designpatterns/structural/proxy/president/PresidentSecretary.java +++ b/src/main/java/com/designpatterns/structural/proxy/president/PresidentSecretary.java @@ -13,9 +13,9 @@ public class PresidentSecretary { if(!isMessageValid(message)) throw new RuntimeException("invalid message"); - System.out.println("message is being sent to the President..."); + System.out.println("Secretary: message is being sent to the President..."); president.talkToThePresident(message); - System.out.println("message is received by the President."); + System.out.println("Secretary: message is sent to the President."); }