Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
design_pattern:proxy_pattern [2018/01/29 13:55] – [Virtual Proxy] ledyxdesign_pattern:proxy_pattern [2022/06/14 17:20] (current) – [Proxy Pattern] ledyx
Line 1: Line 1:
 = Proxy Pattern = = Proxy Pattern =
-Lazy loading. 본인이 필요해질 때까지 대리인(Proxy)에게 위임. 본인에 대한 접근(Access)를 줄여주는 패턴.+본인이 필요해질 때까지 대리인(Proxy)에게 위임. 본인에 대한 접근(Access)를 줄여주는 패턴.
  
-{{tag>Architecture Modeling Structural}}+  * **<fc red>접근 제어</fc>** 
 +    * Authorization 
 +    * Caching 
 +    * Lazy loading 
 +  * [[design_pattern:decorator_pattern|부가 기능 추가]] 
 + 
 +{{tag>Architecture Modeling Design_Pattern Structural}}
  
 = Virtual Proxy = = Virtual Proxy =
-Instance가 필요한 시점에서 생성 및 초기화를 실행. 필요한 객체만 생성하여 초기화시 속도 향상. 이 때, RealSubject 역할은 Proxy의 존재를 알지 못함. (말 그대로 대리자.)+Instance가 필요한 시점에서 생성 및 초기화를 실행. 필요한 객체만 생성하여 초기화시 속도 향상. 이 때, RealSubject 역할은 Proxy의 존재를 알지 못함. (말 그대로 대리자.) Lazy Loading.
  
 == API == == API ==
Line 114: Line 120:
  System.out.println("Who are you? " + p.getPrinterName());  System.out.println("Who are you? " + p.getPrinterName());
   
- // 무거운 작업+ // 대리자가 처리할 수 없는 무거운 작업. 이 때, RealSubject가 필요해지는 시점. (Lazy loading)
  p.print("Hello, world!");  p.print("Hello, world!");
  }  }
 } }
 +
 +
 +/*
 +Who are you? Luke
 +Who are you? Michael
 +Printer의 instance Michael 생성 중
 +.....완료!
 +Michael / Hello, world!
 +*/
 </sxh> </sxh>
  
design_pattern/proxy_pattern.1517234135.txt.gz · Last modified: (external edit)