SlideShare a Scribd company logo
1
lahuman.jabsiri.co.kr
Design Pattern-4
Structural Design Pattern-1
Version 2015-03-04
–임광규 lahuman@daum.net
2
lahuman.jabsiri.co.kr
Agenda
Adapter Pattern
Composite Pattern
Proxy Pattern
Flyweight Pattern
Facade Pattern
Bridge Pattern
Decorator Pattern
3
lahuman.jabsiri.co.kr
Adapter Pattern-1
- What is Adapter Pattern? -
관련 없는 인터페이스를 함께 사용할수 있도록 지원
휴대폰 충전기 같이 가정용 전력 (220V) 를 휴대폰이 요구하는
전력 (2V) 으로 변환
220V 2VAdapter
4
lahuman.jabsiri.co.kr
Adapter Pattern-2
- How can make? -
Class Adapter
자바의 상속을 이용하여 인터페이스 구현
Object Adapter
객체를 내부 멤버 변수로 선언하고 인터페이스 구현
두 방식의 결과는 같음
소스 : https://github.com/lahuman/study4DesignPattern/tree/master/StructuralDesignPatterns/src/kr/pe/lahuman/adapter
5
lahuman.jabsiri.co.kr
Composite Pattern-1
- What is Composite Pattern? -
객체와 객체의 그룹을 구분없이 하나의 인터페이스로 구분 없
이 사용
Composite Pattern 은 대부분 다음의 객체로 구성
Base Component – Leaf 객체에 구성이 되는 인터페이스
Leaf – Base Component 를 상속받아 동작을 구현
Composite – base Component 의 그룹을 가지고 있으며 그룹을
관리와 명령 (operation) 을 실행
6
lahuman.jabsiri.co.kr
Composite Pattern-2
- How can make? -
이해를 돕기 위한 예제 :
원 , 라인 , 삼각형 등 의 선택된 객체에 모두 같은 색으로 채
우는 프로그램
소스 : https://github.com/lahuman/study4DesignPattern/tree/master/StructuralDesignPatterns/src/kr/pe/lahuman/composite
7
lahuman.jabsiri.co.kr
Proxy Pattern-1
- What is Proxy Pattern? -
실제 사용하려는 객체를 대신해서 역활을 해주는 패턴
사용 예
Virtual Proxy – 객체 생성에 많은 비용이 발생시 사용
Remote Proxy – 원격객체에 대한 로컬의 대리자 역활
Protection Proxy – 접근제어가 필요한 객체에 대한 접근을 통제
Smart Reference – 실제객체에 접근할때 부가적인 기능 수행
8
lahuman.jabsiri.co.kr
Proxy Pattern-2
- How can make? -
이해를 돕기 위한 예제 :
- 클라이언트에서 서버에 특정 명령을 실행하는 클래스
- 서버의 시스템 파일을 지우는 명령이 실행 될 경우 문제가 발생
- Proxy 클래스를 생성하고 허용된 사용자에게만 프로그램 허용
소스 : https://github.com/lahuman/study4DesignPattern/tree/master/StructuralDesignPatterns/src/kr/pe/lahuman/proxy
9
lahuman.jabsiri.co.kr
Flyweight Pattern-1
- What is Flyweight Pattern? -
효율적으로 세분화된 많은 수의 객체를 지원하기 위해 공유를
사용 하는 패턴
한번 생성된 객체는 두번 생성하지않고 풀 (POOL) 을 이용한 관
리
큰 객체를 몇개 생성할 경우
많은 메모리를 사용하는 객체를 생성하고 생성에 많은 시간이
소요될 경우
10
lahuman.jabsiri.co.kr
Flyweight Pattern-2
- How can make? -
이해를 돕기 위한 예제 :
- 공유 객체를 return 하는 flyweight factory 클래스 생성
- Shape 를 구현한 Line 과 Oval 객체가 있고 , Oval 은 색상에 대한
외부 요소를 가짐
소스 : https://github.com/lahuman/study4DesignPattern/tree/master/StructuralDesignPatterns/src/kr/pe/lahuman/flyweight
11
lahuman.jabsiri.co.kr
참고 URL
http://www.journaldev.com/1562/flyweight-pattern-in-java-example-tutorial
http://www.oodesign.com/flyweight-pattern.html
12
lahuman.jabsiri.co.kr
All text and image content in this document is licensed under the Creative Commons Attribution-Share Alike 3.0 License
(unless otherwise specified). "LibreOffice" and "The Document Foundation" are registered trademarks. Their respective logos
and icons are subject to international copyright laws. The use of these therefore is subject to the trademark policy.
감사합니다 .
이전 자료 : http://www.slideshare.net/lahuman1
블로그 : http://lahuman.jabsiri.co.kr
이문서는 LibreOffice 의 Templet 을 이용해 제작 되었습니다 .

More Related Content

ODP
Desing Pattern-2
ODP
Design Pattern 3
PPT
개발 생산성 향상 기법 V1.2
PDF
한글 자동완성 구현하기
PDF
[MeetUp][2nd] 알아두면 쓸모있는 테라폼
PDF
모두의 클라우드 딥러닝
PPTX
bamboo 로 PHP 프로젝트 지속적인 배포
PDF
React vac pattern
Desing Pattern-2
Design Pattern 3
개발 생산성 향상 기법 V1.2
한글 자동완성 구현하기
[MeetUp][2nd] 알아두면 쓸모있는 테라폼
모두의 클라우드 딥러닝
bamboo 로 PHP 프로젝트 지속적인 배포
React vac pattern

What's hot (20)

PDF
[D2 CAMPUS] tech meet up(Back-end) - 교내 웹서비스 개발 일지 (박은찬님)
PPTX
[125]react로개발자2명이플랫폼4개를서비스하는이야기 심상민
PDF
GraphQL in Action - REST와 이별할 때 생각해야 하는 것들
PPTX
Vingle tech talk #1
PDF
티켓몬스터를 위한 PHP 개발 방법
PDF
한글 형태소 분석기 활용하기
PDF
예제를 통해 쉽게_살펴보는_뷰제이에스
PDF
200819 NAVER TECH CONCERT 08_성능을 고민하는 슬기로운 개발자 생활
PDF
[부스트캠프 Tech Talk]손정현_PUB/SUB를 적용한 Todo앱 만들기(순한맛)
PPTX
[114]angularvs react 김훈민손찬욱
PPTX
[123] electron 김성훈
PDF
제 5회 D2 CAMPUS SEMINAR - Swift로 만든 serverframework 개발기
PDF
Electron mainprocess
PDF
커뮤니티와 함께한 예비개발자 성장기- 조성수님
PDF
PHP로 웹개발을 해보자
PDF
[D2 campus]착 하면 척! chak 서비스 개발기
PDF
Kgc2014 삼한제국기 포스트모템 김찬웅
PDF
[부스트캠퍼세미나]육진혁_(대충 도커 쓰자는 이야기)
PDF
리액트 적용기
PPTX
개발 방식을 바꾸는 15가지 기술
[D2 CAMPUS] tech meet up(Back-end) - 교내 웹서비스 개발 일지 (박은찬님)
[125]react로개발자2명이플랫폼4개를서비스하는이야기 심상민
GraphQL in Action - REST와 이별할 때 생각해야 하는 것들
Vingle tech talk #1
티켓몬스터를 위한 PHP 개발 방법
한글 형태소 분석기 활용하기
예제를 통해 쉽게_살펴보는_뷰제이에스
200819 NAVER TECH CONCERT 08_성능을 고민하는 슬기로운 개발자 생활
[부스트캠프 Tech Talk]손정현_PUB/SUB를 적용한 Todo앱 만들기(순한맛)
[114]angularvs react 김훈민손찬욱
[123] electron 김성훈
제 5회 D2 CAMPUS SEMINAR - Swift로 만든 serverframework 개발기
Electron mainprocess
커뮤니티와 함께한 예비개발자 성장기- 조성수님
PHP로 웹개발을 해보자
[D2 campus]착 하면 척! chak 서비스 개발기
Kgc2014 삼한제국기 포스트모템 김찬웅
[부스트캠퍼세미나]육진혁_(대충 도커 쓰자는 이야기)
리액트 적용기
개발 방식을 바꾸는 15가지 기술
Ad

Viewers also liked (20)

PPTX
Learn design pattern-1
PPTX
예제로 보는 Pattern 연상법
PPT
Proxy pattern
PPTX
Scalable system design patterns
KEY
Adapter pattern 한진수
PPTX
데브루키 스터디 발표
PDF
Oop design principle
PDF
게임 개발에 자주 사용되는 디자인 패턴
PDF
PLoP 09 review
PPTX
Adapter Pattern
PPTX
Bridge
PPTX
블랙보드 개발 중인 기능
PDF
Pattern and EA
PPTX
Team10:TenTen for blackboard
PPTX
Publish Subscriber messaging pattern
PPTX
Design pattern study 6 command pattern
PDF
Design patterns 스터디 - Singleton 패턴
PPTX
Observer pattern dragor
PPTX
Decorator pattern
PDF
Design patterns 스터디 -Decorator 패턴
Learn design pattern-1
예제로 보는 Pattern 연상법
Proxy pattern
Scalable system design patterns
Adapter pattern 한진수
데브루키 스터디 발표
Oop design principle
게임 개발에 자주 사용되는 디자인 패턴
PLoP 09 review
Adapter Pattern
Bridge
블랙보드 개발 중인 기능
Pattern and EA
Team10:TenTen for blackboard
Publish Subscriber messaging pattern
Design pattern study 6 command pattern
Design patterns 스터디 - Singleton 패턴
Observer pattern dragor
Decorator pattern
Design patterns 스터디 -Decorator 패턴
Ad

Similar to Design pattern 4 (20)

PPTX
XECon2015 :: [2-1] 정광섭 - 처음 시작하는 laravel
PPTX
처음 시작하는 라라벨
PDF
LucideWorks Banana 소개
PPTX
Electron forge
PPTX
파이썬 플라스크 이해하기
PPTX
서버 아키텍처 이해를 위한 프로세스와 쓰레드
PDF
Let'Swift 2023 Swift Macro, 어디다 쓰죠?
PDF
deview2014
PDF
[1A4]자바스크립트 라이브러리 개발 운영 경험기
PPTX
How_to_choose_the_right_framework
PPTX
20250725_Kit-Works Team Study_Spring AI.pptx
PPTX
Design patterns
PPTX
Spring Boot + React + Gradle in VSCode
PDF
도구를 활용한 더 나은 웹 개발: Yeoman
PDF
메이븐 기본 이해
PDF
테스터도 알아야 할 웹 개발(테스트 교육 3장 1절 부분발췌)
PPT
레일스를 이용한 애자일 웹 개발 가이드
PDF
스프링 스터디 1장
PDF
Spring AI 활용 실습 - 챗봇부터 Tools, RAG, 추론모델 활용까지
PDF
디자인패턴
XECon2015 :: [2-1] 정광섭 - 처음 시작하는 laravel
처음 시작하는 라라벨
LucideWorks Banana 소개
Electron forge
파이썬 플라스크 이해하기
서버 아키텍처 이해를 위한 프로세스와 쓰레드
Let'Swift 2023 Swift Macro, 어디다 쓰죠?
deview2014
[1A4]자바스크립트 라이브러리 개발 운영 경험기
How_to_choose_the_right_framework
20250725_Kit-Works Team Study_Spring AI.pptx
Design patterns
Spring Boot + React + Gradle in VSCode
도구를 활용한 더 나은 웹 개발: Yeoman
메이븐 기본 이해
테스터도 알아야 할 웹 개발(테스트 교육 3장 1절 부분발췌)
레일스를 이용한 애자일 웹 개발 가이드
스프링 스터디 1장
Spring AI 활용 실습 - 챗봇부터 Tools, RAG, 추론모델 활용까지
디자인패턴

More from Daniel Lim (20)

PDF
내가 생각하는 개발자란?
PDF
개발자를 넘어 기술 리더로 가는 길을 읽고
PDF
스크럼 101
PDF
nodejs_101.pdf
PDF
For You
PPTX
Nest js 101
PPTX
피드백 시스템
PDF
13.code split
PDF
12.context api
PDF
11.react router dom
PDF
9.component style
PDF
7.component life cycle
PDF
8.hooks
PDF
6.component repeat
PDF
4.event handling
PDF
5.ref 101
PDF
3.component 101
PDF
2.jsx 101
PDF
1.react 101
PDF
Swagger? OAS? with NodeJS
내가 생각하는 개발자란?
개발자를 넘어 기술 리더로 가는 길을 읽고
스크럼 101
nodejs_101.pdf
For You
Nest js 101
피드백 시스템
13.code split
12.context api
11.react router dom
9.component style
7.component life cycle
8.hooks
6.component repeat
4.event handling
5.ref 101
3.component 101
2.jsx 101
1.react 101
Swagger? OAS? with NodeJS

Design pattern 4

  • 1. 1 lahuman.jabsiri.co.kr Design Pattern-4 Structural Design Pattern-1 Version 2015-03-04 –임광규 lahuman@daum.net
  • 2. 2 lahuman.jabsiri.co.kr Agenda Adapter Pattern Composite Pattern Proxy Pattern Flyweight Pattern Facade Pattern Bridge Pattern Decorator Pattern
  • 3. 3 lahuman.jabsiri.co.kr Adapter Pattern-1 - What is Adapter Pattern? - 관련 없는 인터페이스를 함께 사용할수 있도록 지원 휴대폰 충전기 같이 가정용 전력 (220V) 를 휴대폰이 요구하는 전력 (2V) 으로 변환 220V 2VAdapter
  • 4. 4 lahuman.jabsiri.co.kr Adapter Pattern-2 - How can make? - Class Adapter 자바의 상속을 이용하여 인터페이스 구현 Object Adapter 객체를 내부 멤버 변수로 선언하고 인터페이스 구현 두 방식의 결과는 같음 소스 : https://github.com/lahuman/study4DesignPattern/tree/master/StructuralDesignPatterns/src/kr/pe/lahuman/adapter
  • 5. 5 lahuman.jabsiri.co.kr Composite Pattern-1 - What is Composite Pattern? - 객체와 객체의 그룹을 구분없이 하나의 인터페이스로 구분 없 이 사용 Composite Pattern 은 대부분 다음의 객체로 구성 Base Component – Leaf 객체에 구성이 되는 인터페이스 Leaf – Base Component 를 상속받아 동작을 구현 Composite – base Component 의 그룹을 가지고 있으며 그룹을 관리와 명령 (operation) 을 실행
  • 6. 6 lahuman.jabsiri.co.kr Composite Pattern-2 - How can make? - 이해를 돕기 위한 예제 : 원 , 라인 , 삼각형 등 의 선택된 객체에 모두 같은 색으로 채 우는 프로그램 소스 : https://github.com/lahuman/study4DesignPattern/tree/master/StructuralDesignPatterns/src/kr/pe/lahuman/composite
  • 7. 7 lahuman.jabsiri.co.kr Proxy Pattern-1 - What is Proxy Pattern? - 실제 사용하려는 객체를 대신해서 역활을 해주는 패턴 사용 예 Virtual Proxy – 객체 생성에 많은 비용이 발생시 사용 Remote Proxy – 원격객체에 대한 로컬의 대리자 역활 Protection Proxy – 접근제어가 필요한 객체에 대한 접근을 통제 Smart Reference – 실제객체에 접근할때 부가적인 기능 수행
  • 8. 8 lahuman.jabsiri.co.kr Proxy Pattern-2 - How can make? - 이해를 돕기 위한 예제 : - 클라이언트에서 서버에 특정 명령을 실행하는 클래스 - 서버의 시스템 파일을 지우는 명령이 실행 될 경우 문제가 발생 - Proxy 클래스를 생성하고 허용된 사용자에게만 프로그램 허용 소스 : https://github.com/lahuman/study4DesignPattern/tree/master/StructuralDesignPatterns/src/kr/pe/lahuman/proxy
  • 9. 9 lahuman.jabsiri.co.kr Flyweight Pattern-1 - What is Flyweight Pattern? - 효율적으로 세분화된 많은 수의 객체를 지원하기 위해 공유를 사용 하는 패턴 한번 생성된 객체는 두번 생성하지않고 풀 (POOL) 을 이용한 관 리 큰 객체를 몇개 생성할 경우 많은 메모리를 사용하는 객체를 생성하고 생성에 많은 시간이 소요될 경우
  • 10. 10 lahuman.jabsiri.co.kr Flyweight Pattern-2 - How can make? - 이해를 돕기 위한 예제 : - 공유 객체를 return 하는 flyweight factory 클래스 생성 - Shape 를 구현한 Line 과 Oval 객체가 있고 , Oval 은 색상에 대한 외부 요소를 가짐 소스 : https://github.com/lahuman/study4DesignPattern/tree/master/StructuralDesignPatterns/src/kr/pe/lahuman/flyweight
  • 12. 12 lahuman.jabsiri.co.kr All text and image content in this document is licensed under the Creative Commons Attribution-Share Alike 3.0 License (unless otherwise specified). "LibreOffice" and "The Document Foundation" are registered trademarks. Their respective logos and icons are subject to international copyright laws. The use of these therefore is subject to the trademark policy. 감사합니다 . 이전 자료 : http://www.slideshare.net/lahuman1 블로그 : http://lahuman.jabsiri.co.kr 이문서는 LibreOffice 의 Templet 을 이용해 제작 되었습니다 .