Created
May 20, 2019 06:18
-
-
Save hackjutsu/0bbfd4b86b245d0b2f65ac151e6296ea to your computer and use it in GitHub Desktop.
[medium snippets] #medium #designPattern #ProxyPattern
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class RealImage implements Image { | |
private String fileName; | |
public RealImage(String fileName){ | |
this.fileName = fileName; | |
loadFromDisk(fileName); | |
} | |
@Override | |
public void display() { | |
System.out.println("Displaying " + fileName); | |
} | |
private void loadFromDisk(String fileName){ | |
System.out.println("Loading " + fileName); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment