-
Notifications
You must be signed in to change notification settings - Fork 0
Pattern
hyunwoo9301 edited this page Jul 22, 2017
·
4 revisions
프로그램 내에서 하나의 인스턴스로 관리, 생성자를 private로 선언해 외부에서 직접 new 키워드로 생성을 막음
class Singleton{
private static Singleton instance = new Singleton();
private Singleton(){}
public static Singleton getInstance(){
return instance;
}
}
- 타깃과 클라이언트의 코드 수정없이 동적으로 추가적인 기능들을 가진 객체를 덧붙이는 패턴
프록시 패턴은 접근시 프록시를 통하게 하는것, 데코레이터 패턴은 실행 타깃의 확장을 의미
- 클라이언트가 타깃에 접근하는 방법을 제어, 타깃에 부가적인 기능을 부여
- 핵심적인 기능에서 분리된 부가적인 기능을 Proxy에서 처리
- 리플렉션기능을 이용해 이용해 타깃 인터페이스와 동일한 형태로 런타임시 만들어지는 오브젝트
-
Spring
-
Web
-
Security
-
ETC