Skip to content

Instantly share code, notes, and snippets.

@hackjutsu
Created May 20, 2019 06:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hackjutsu/0bbfd4b86b245d0b2f65ac151e6296ea to your computer and use it in GitHub Desktop.
Save hackjutsu/0bbfd4b86b245d0b2f65ac151e6296ea to your computer and use it in GitHub Desktop.
[medium snippets] #medium #designPattern #ProxyPattern
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