Microsoft PowerPoint - Gof - What is Design Patterns - Gof Design Pattterns



Similar documents
<C0DAB7E120C7D5BABB2E687770>


본문01

<32382DC3BBB0A2C0E5BED6C0DA2E687770>

Page 2 of 6 Here are the rules for conjugating Whether (or not) and If when using a Descriptive Verb. The only difference here from Action Verbs is wh

Page 2 of 5 아니다 means to not be, and is therefore the opposite of 이다. While English simply turns words like to be or to exist negative by adding not,

Something that can be seen, touched or otherwise sensed

Stage 2 First Phonics

#Ȳ¿ë¼®

歯3이화진

untitled

12Á¶±ÔÈŁ

03.Agile.key

04-다시_고속철도61~80p

제목

Output file


¹Ìµå¹Ì3Â÷Àμâ

- 2 -

장양수


Hi-MO 애프터케어 시스템 편 5. 오비맥주 카스 카스 후레쉬 테이블 맥주는 천연식품이다 편 처음 스타일 그대로, 부탁 케어~ Hi-MO 애프터케어 시스템 지속적인 모발 관리로 끝까지 스타일이 유지되도록 독보적이다! 근데 그거 아세요? 맥주도 인공첨가물이

감각형 증강현실을 이용한

I&IRC5 TG_08권

歯1.PDF

0125_ 워크샵 발표자료_완성.key

11¹Ú´ö±Ô

274 한국문화 73

<31B1E8C0B1C8F128C6ED2E687770>

Domino Designer Portal Development tools Rational Application Developer WebSphere Portlet Factory Workplace Designer Workplace Forms Designer

Journal of Educational Innovation Research 2016, Vol. 26, No. 2, pp DOI: * Experiences of Af

1_2•• pdf(••••).pdf

하나님의 선한 손의 도우심 이세상에서 가장 큰 축복은 하나님이 나와 함께 하시는 것입니다. 그 이 유는 하나님이 모든 축복의 근원이시기 때문입니다. 에스라서에 보면 하나님의 선한 손의 도우심이 함께 했던 사람의 이야기 가 나와 있는데 에스라 7장은 거듭해서 그 비결을

<B1E2C8B9BEC828BFCFBCBAC1F7C0FC29322E687770>

大学4年生の正社員内定要因に関する実証分析


Journal of Educational Innovation Research 2018, Vol. 28, No. 3, pp DOI: NCS : * A Study on

<C7D1B9CEC1B7BEEEB9AEC7D03631C1FD28C3D6C1BE292E687770>

<B3EDB9AEC1FD5F3235C1FD2E687770>


300 구보학보 12집. 1),,.,,, TV,,.,,,,,,..,...,....,... (recall). 2) 1) 양웅, 김충현, 김태원, 광고표현 수사법에 따른 이해와 선호 효과: 브랜드 인지도와 의미고정의 영향을 중심으로, 광고학연구 18권 2호, 2007 여름

001지식백서_4도

10송동수.hwp

<31342D3034C0E5C7FDBFB52E687770>

Journal of Educational Innovation Research 2019, Vol. 29, No. 1, pp DOI: * Suggestions of Ways

<30352DC0CCC7F6C8F B1B3292DBFACB1B8BCD2B1B3C1A42E687770>

30이지은.hwp

Intro to Servlet, EJB, JSP, WS

15_3oracle

DBPIA-NURIMEDIA

SW¹é¼Ł-³¯°³Æ÷ÇÔÇ¥Áö2013

untitled

06.AnalysisModeling.key

<30362E20C6EDC1FD2DB0EDBFB5B4EBB4D420BCF6C1A42E687770>

pdf 16..


강의지침서 작성 양식

DBPIA-NURIMEDIA

13 Who am I? R&D, Product Development Manager / Smart Worker Visualization SW SW KAIST Software Engineering Computer Engineering 3

퇴좈저널36호-4차-T.ps, page Preflight (2)

11이정민

<B3EDB9AEC1FD5F3235C1FD2E687770>

야쿠르트2010 9월재출

Journal of Educational Innovation Research 2016, Vol. 26, No. 1, pp.1-19 DOI: *,..,,,.,.,,,,.,,,,, ( )

1. 서론 1-1 연구 배경과 목적 1-2 연구 방법과 범위 2. 클라우드 게임 서비스 2-1 클라우드 게임 서비스의 정의 2-2 클라우드 게임 서비스의 특징 2-3 클라우드 게임 서비스의 시장 현황 2-4 클라우드 게임 서비스 사례 연구 2-5 클라우드 게임 서비스에

< FC3D6C1BEBCF6C1A45FB1E2B5B6B1B3B1B3C0B0B3EDC3D E687770>

H3050(aap)

학습영역의 Taxonomy에 기초한 CD-ROM Title의 효과분석

_KF_Bulletin webcopy

<BCF6BDC D31385FB0EDBCD3B5B5B7CEC8DEB0D4C5B8BFEEB5B5C0D4B1B8BBF3BFACB1B85FB1C7BFB5C0CE2E687770>

09김정식.PDF

ÀÌÀç¿ë Ãâ·Â

Vol.257 C O N T E N T S M O N T H L Y P U B L I C F I N A N C E F O R U M

thesis

OOP 소개

서론 34 2

182 동북아역사논총 42호 금융정책이 조선에 어떤 영향을 미쳤는지를 살펴보고자 한다. 일제 대외금융 정책의 기본원칙은 각 식민지와 점령지마다 별도의 발권은행을 수립하여 일본 은행권이 아닌 각 지역 통화를 발행케 한 점에 있다. 이들 통화는 일본은행권 과 等 價 로 연

<BFACBCBCC0C7BBE7C7D E687770>

2 KHU 글로벌 기업법무 리뷰 제2권 제1호 또 내용적으로 중대한 위기를 맞이하게 되었고, 개인은 흡사 어항 속의 금붕어 와 같은 신세로 전락할 운명에 처해있다. 현대정보화 사회에서 개인의 사적 영역이 얼마나 침해되고 있는지 는 양 비디오 사건 과 같은 연예인들의 사

<C0C7B7CAC0C720BBE7C8B8C0FB20B1E2B4C9B0FA20BAAFC8AD5FC0CCC7F6BCDB2E687770>

example code are examined in this stage The low pressure pressurizer reactor trip module of the Plant Protection System was programmed as subject for

공연영상

27 2, 17-31, , * ** ***,. K 1 2 2,.,,,.,.,.,,.,. :,,, : 2009/08/19 : 2009/09/09 : 2009/09/30 * 2007 ** *** ( :

DBPIA-NURIMEDIA

소프트웨어개발방법론

2 min 응용 말하기 01 I set my alarm for It goes off. 03 It doesn t go off. 04 I sleep in. 05 I make my bed. 06 I brush my teeth. 07 I take a shower.

<B1A4B0EDC8ABBAB8C7D0BAB8392D345F33C2F75F E687770>

Microsoft PowerPoint - 27.pptx

74 현대정치연구 2015년 봄호(제8권 제1호) Ⅰ. 서론 2015년 1월 7일, 프랑스 파리에서 총격 사건이 발생했다. 두 명의 남성이 풍자 잡지 주간 샤를리 의 본사에 침입하여 총기를 난사한 것이다. 이 사건으로 인해 열두 명의 사람이 목숨을 잃었다. 얼마 후에

우리들이 일반적으로 기호

step 1-1

OP_Journalism

지능정보연구제 16 권제 1 호 2010 년 3 월 (pp.71~92),.,.,., Support Vector Machines,,., KOSPI200.,. * 지능정보연구제 16 권제 1 호 2010 년 3 월

Microsoft Word doc

DE1-SoC Board

UPMLOPEKAUWE.hwp

야쿠르트2010 3월 - 최종

슬라이드 1

<31325FB1E8B0E6BCBA2E687770>

Microsoft PowerPoint - ch03ysk2012.ppt [호환 모드]

Transcription:

What is Design Patterns? - Gof Design Patterns - Service Innovation

Design Principles Service Innovation

Reality of SW world comparing with HW World How can we implement complex, abstract, and dynamic real world in software? 복잡하고 추상적이며 역동적인 현실세계를 어떻게 software로 구현할까? Change is inevitable! So change development process so that we can address change more effectively. 변화(change)를 피할수없다면, 변화를 수용할 수 있도록 어떻게 디자인 프로세스를 변경할 것인가? SW World Pluggable System HW World 3

Business System Analysis and Design Business System Analysis: do the Right Thing Emphasize an investigation of the problem and requirements, rather than a solution. Requirements analysis: an investigation of the requirements or Object-oriented analysis: an investigation of the domain objects Design: do the Thing Right Emphasizes a conceptual solution (in software and hardware) that fulfills the requirements, rather than its implementation. objects Request Message 4

Views on the Problem Domain We model the system a number of objects that interact / collaborate. Object orientation is ideally suited to creating models of real systems. Procedure-oriented View Real World View with Collaboration and delegation Object-oriented View Service Request Interacting objects Service Response Objects communicate with requests. A request is a message specifying that an indicated operation be carried out using one or more objects and, optionally, returning a result. 5

How Humans work in Real World? Service-orient Abstraction Information Hiding Encapsulation Collaboration Single Responsibility Principle Your objects only one reason to change. Decomposition, Top-down Cohesion / Coupling Interface Delegation Shift Responsibility Aggregation Polymorphism Dynamic Real World View with Collaboration and delegation Service Request Service Response Object-oriented View Interacting objects 6

Maintainability Expandability / Portability / Modifiability / Readability / Flexibility do the Right Thing Business System Service Request Not what user Asked, Not what user Wanted, But what user Needed! do the Thing Right Information System Interacting objects Service Response Service-orient Business Process Innovation Requirements Component-based Pattern-oriented Object-oriented Architecture / Design 7

Problems of Requirements The Nature of Requirements, illogic of Business Rules Requirements are incomplete. Requirements are usually wrong. Requirements (and users) are misleading. Requirements do not tell the whole story;. Requirements always change. The user s view of their needs changes. The developer s view of the user s problem domain changes The environment in which the software is being developed changes. Moving target problem While the information system is being developed, the requirements change. Change happens! Deal with it. Rather than complaining about changing requirements, we should change the development process so that we can address change more effectively. We may not know what will change, but I can guess where! 8

Problems of Debugging / Maintenance Changing a function, or even data used by a function, can weak havoc on other function The overwhelming amount of time involved in maintenance and debugging is spent on trying to discover how the code works and finding and taking the time to avoid unwanted side effects. The devil is in the Side-Effects A focus on functions is likely to cause side effects that are difficult to find. Most of time spent in maintenance and debugging is not spent on fixing bugs, but in finding them and seeing how to avoid unwanted side effects from the fix. We really do not spend much time fixing bugs. The actual fix is relatively short! 9

Design Principles to deal with Inevitable Changes. Designing from Context Principle Be independent from other parts. Eliminate dependency to others. Requirements Requirements Always change. Service-oriented Architecture CB Design Design Patterns Object-orient Problem Problem of of Debugging/Maintenance Finding where to fix. Avoiding Side-Effect. Change happens. Deal with it! Open for Extension but Close for Modification. Find what varies and Encapsulate it! Loosely Coupled Design only one reason to change. Only talk to your immediate friends. Depend on Abstraction. Program to Interface, not Implementation. Don t call us, we ll call you. Favor Aggregation over Inheritance. Only one place to change! 10

Designing from Context Principle Design from Context, to create the big picture before designing the details. Start with a service-orientation. Define the services at an abstract level. Dependency Inversion Principle High-level modules should not depend on low-level modules. Both highlevel modules and low-level modules should depend upon abstraction. Abstraction should not depend on details. Details should depend upon abstraction. Complexification The process of starting at the simplest (Conceptual) level and gradually adding details and features, making the design more complex as you go deeper. 11

Object-orient Principles Whenever possible, try to Encapsulate what varies. Favor Aggregation/Composition over Inheritance. Program to Interface, not Implementation. The Open-Close Principle (OCP) Classes should be Open for Extension but Close for Modification. Single Responsibility Principle (SRP) A class should have only one reason to change. The Power of Loose Coupling Principle Strive for loosely coupled designs between objects that interact. Least knowledge Principle (LKP) Only talk to your immediate friends. Dependency Inversion Principle Depend on Abstractions. Do not depend on concrete classes. Hollywood Principle Don t call us, we ll call you. 12

Design Principle Roundup Using proven OO design principles result in more maintainable, flexible, and extensible software. 변화되는 것을 캡슐화 하라! 구현 보다는 인터페이스(Super type) 에 맞춰 프로 그래밍하라! 각 클래스는 단 한가지 일만 해야 한다. 클래스란 행위와 기능이다. 13

Object-orient Design Principles Principle #1 개방-폐쇄 원칙 Principle #2 복제금지 원칙 Principle #3 단일 책임 원칙 Principle #4 리스코프 치환 원칙 14

Gof Design Patterns Service Innovation

Object-oriented Design is Designing object-oriented software is hard. Designing reusable object-oriented software is even harder. You must find pertinent objects, factor them into classes at right granularity define class interface and inheritance hierarchies, and establish key relationships among them. Your design should be specific to the problem at hand, but also general enough to address future problems and requirements avoid redesign, or at least minimize it. 16

전문가들은 어떻게 하나? 초보자들은 너무 많은 개념들과 이를 실행할 수 있는 다양한 방법론에 당황해서, 자신들이 전에 사용했던 객체지향 기술이 아닌 쪽으로 되돌아갈 수 있다. One thing expert designers know not to do is solve every problem from first principles. Rather, they reuse solutions that have worked for them in the past. When they find a good solution, they use it again and again. Such experience is part of what makes them expert. 17

디자인 패턴이 해결책 누군가가 이미 여러분들이 고민하는 문제를 해결해 놓았습니다. 똑같은 문제를 경험했고, 그 문제를 해결했던 다른 개발자들이 익혔던 지혜와 교훈을 왜 활용해야 하는지? 어떻게 활용할 수 있는지? 18

What is Design Patterns? Each pattern describes Describes a problem which occurs over and over again in our environment, 기존 환경 내에서 반복적으로 일어나는 문제를 설명하고, And then describes the core of the solution to that problem. 그 문제들에 대한 해법의 핵심을 설명하는 것이다. In such a way that you can use this solution a million times over, without ever doing it the same way twice 이렇게 하면 똑같은 방법을 두 번 반복하지 않은 채,이 해법을백만번이상재사용할수있다. 특별한 상황에서 일반적 설계 문제를 해결하기 위해 상호 교류하는 수 정 가능한 객체와 클래스들에 대한 설명 재사용 가능한 객체지향 설계를 만들기 위해 유용한 공통의 설계 구조 로부터 중요 요소들을 식별하여 이들에게 적당한 이름을 주고 추상화 한것 19

Objective of Patterns Creational Patterns: abstract the instantiation process. help make a system independent of how its object are created, composed, and represented. gives you a lot of flexibility in what gets created, who creates it, how it gets created, and when. Structural Pattern: are concerned with how classes and objects are composed to form larger structure. Behavioral Patterns: are concerned with algorithms and the assignment of responsibilities between objects. shift your focus away from flow of control to let you concentrate just on the way objects are interconnected. Objective Creation Structure Behavior S c o p e Class (Static) Object (Dynamic) Factory Method Abstract Factory Builder Prototype Singleton Adapter (Class) Adapter (object) Bridge Composite Decorator Façade Flyweight Proxy Interpreter Template Method Chain of Responsibility Command, Iterator, Mediator, Memento, Observer State Strategy Visitor 20

Creational Patterns Creational Patterns: abstract the instantiation process. help make a system independent of how its object are created, composed, and represented. gives you a lot of flexibility in what gets created, who creates it, how it gets created, and when. become important as systems evolve to depend more on object composition than class inheritance. As that happen, emphasis shifts away from hard-coding a fixed set of behaviors toward defining a smaller set of fundamental behaviors that can be composed into any number of more complex one. Two recurring themes in Creational Patterns 1) They all encapsulate knowledge about which concrete classes the system use. 2) They hide how instances of these classes are created and put together. A Class Creational Pattern Uses inheritance to vary the class that s instantiated Object Creational Patterns Delegate instantiation to another object Scope Design pattern Aspect(s) that can vary Class (Static) Factory Method 대행함수를 통한 객체 생성 문제 Abstract Factory 제품군별 객체 생성 문제 Object (Dynamic) Builder 부분 부분 생성을 통한 전체 객체 생성 문제 Prototype 복제를 통한 객체 생성 문제 Singleton 최대 N개로 객체 생성을 제한하는 문제 21

Structural Patterns 구조 패턴 (Structural Pattern) are concerned with how classes and objects are composed to form larger structures. Structural Class Pattern (Static fixed at compile time) Use inheritance to compose interfaces or implementations. Structural object patterns (dynamic can be changed at runtime) Rather than compositing interfaces or implementations, structural object patterns describe ways to compose objects to realize new functionality. The added flexibility of object composition comes from the ability to change the composition at run-time, which is impossible with static class composition. Design pattern Adapter (Class/Object) Bridge Composite Decorator Facade Flyweight Proxy Aspect(s) that can vary 기존 모듈 재사용을 위한 인터페이스 변경 문제 인터페이스와 구현의 명확한 분리 문제 부분-전체 관계 형성 및 관리 문제 특정 객체의 기능 동적 추가, 삭제 문제 서브 시스템의 명확한 정의 문제 객체의 공유 문제 대리 객체를 통한 작업 수행 문제 22

Behavioral Patterns Behavioral Patterns are concerned with algorithms and the assignment of responsibilities between objects. describe not just patterns of objects or classes but also the patterns of communication between them. characterize complex control flow that s difficult to follow at run-time. shift your focus away from flow of control to let you concentrate just on the way objects are interconnected. Behavioral Class Patterns Use inheritance to distribute behavior between class. Behavioral Object Patterns Use object composition rather than inheritance. Scope Design pattern Aspect(s) that can vary Class Interpreter 간단한 문법에 기반한 검증 및 작업 처리 문제 (Static) Template Method 알고리즘 기본 골격 재사용과 상세구현 변경 문제 Object (Dynamic) Chain of Responsibility Command Iterator Mediator Memento Observer State Strategy Visitor 수행 가능 객체까지 요청 전파 문제 수행할 작업의 일반화 문제 동일 자료형의 여러 객체에 대한 순차적 접근 문제 M:N 객체 관계의 M:1 단순화 문제 객체의 이전 상태 복원 문제 One source, multiple use 문제 객체 상태 추가에 따른 행위 수행 변경 문제 동일 목적 알고리즘의 선택 적용 문제 작업 종류를 효율적으로 추가, 변경하는 문제 23

Designing for Change To design the system so that it s robust to such changes, You must consider how the system might need to change over its lifetime. A design that doesn t take change into account risks major redesign in the future. Design patterns Help you avoid this by ensuring that a system can change in specific ways. Each design pattern lets some aspect of system structure vary independently of other aspects, thereby making a system more robust to a particular kind of change. Some common causes of redesign Creating an object by specifying a class explicitly. Dependence on specific operations. Dependence on hardware and software platform. Dependence on object representations or implementations. Algorithmic dependencies. Tight coupling. Extending functionality by subclassing. Inability to alter classes conveniently. 24

Design aspects that design patterns let you vary Purpose Design pattern Aspect(s) that can vary Creational Structural Behavioral Abstract Factory Builder Factory Method Prototype Singleton Adapter Bridge Composite Decorator Facade Flyweight Proxy Chain of Responsibility Command Interpreter Iterator Mediator Memento Observer State Strategy Template Method Visitor 제품군별 객체 생성 문제 부분 부분 생성을 통한 전체 객체 생성 문제 대행함수를 통한 객체 생성 문제 복제를 통한 객체 생성 문제 최대 N개로 객체 생성을 제한하는 문제 기존 모듈 재사용을 위한 인터페이스 변경 문제 인터페이스와 구현의 명확한 분리 문제 부분-전체 관계 형성 및 관리 문제 특정 객체의 기능 동적 추가, 삭제 문제 서브 시스템의 명확한 정의 문제 객체의 공유 문제 대리 객체를 통한 작업 수행 문제 수행 가능 객체까지 요청 전파 문제 수행할 작업의 일반화 문제 간단한 문법에 기반한 검증 및 작업 처리 문제 동일 자료형의 여러 객체에 대한 순차적 접근 문제 M:N 객체 관계의 M:1 단순화 문제 객체의 이전 상태 복원 문제 One source, multiple use 문제 객체 상태 추가에 따른 행위 수행 변경 문제 동일 목적 알고리즘의 선택 적용 문제 알고리즘 기본 골격 재사용과 상세구현 변경 문제 작업 종류를 효율적으로 추가, 변경하는 문제 25

Design aspects that design patterns let you vary Purpose Design pattern Aspect(s) that can vary Abstract Factory Families of product objects Builder How a composite object gets created Creational Factory Method Subclass of object that is instantiated Prototype Class of object that is instantiated Singleton The sole instance of a class Adapter Interface to an object Bridge Implementation of an object Composite Structure and composition of an object Structural Decorator Responsibilities of an object without subclassing Facade Interface to a subsystem Flywieght Storage costs of objects Proxy How an object is accessed; its location Chain of Responsibility Object that can fulfill a request Command When and how a request is fulfilled Interpreter Grammar and interpretation of an language Iterator How an aggregate's elements are accessed, traversed Mediator How and which objects interact with each other Memento What private information is stored outside an object, and when Behavioral Observer Number of objects that depend on another object; how the dependent objects stay up to date State State of an object Strategy An algorithm, Template Method Steps of an algorithm Visitor Operations that can be applied to object(s) without changing their class(es) 26

디자인 패턴 관계도 Decorator Changing skin versus guts Builder Creating composites Strategy Prototype Singleton Adding responsibilities to objects Sharing strategies State Saving state of iteration Iterator Flyweight Sharing states Composite Defining algorithm s steps Configure factory dynamically Single instance Interpreter Abstract Factory Single instance Enumerating children Memento Sharing terminal symbols Adding operations Defining grammar Template Method Facade Visitor Avoiding hysteresis Composed using Defining traversals Adding operations Mediator Implement using Command often uses Adapter Bridge Proxy Chain of reaction Complex dependency management Defining the chain Observer Factory Method 27