• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Five pattern(facade mediator_singleton_monostate_null)
 

Five pattern(facade mediator_singleton_monostate_null)

on

  • 253 views

 

Statistics

Views

Total Views
253
Views on SlideShare
253
Embed Views
0

Actions

Likes
0
Downloads
9
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Five pattern(facade mediator_singleton_monostate_null) Five pattern(facade mediator_singleton_monostate_null) Presentation Transcript

    • FAÇADE
      아.꿈.사.
      LHS87
    • What is the Façade?
      n. (건물의) 정면(front), (길에 접해 있는) 앞면;겉보기, 외관, 허울
      -From Naver Dictionary
      A facade is an object that provides a simplified interface to a larger body of code, such as a class library
      -From WIKIPEDIA
    • Structure
    • Example
    • Code
    • What are the good points?
      make a software library easier to use and understand, since the
      facade has convenient methods for common tasks
      2. make code that uses the library more readable, for the same reason
      3.reduce dependencies of outside code on the inner workings
      of a library, since most code uses the facade, thus allowing more flexibility
      in developing the system
      4. wrapa poorly-designed collection of APIs with a single well-designed API
    • Thank you
    • MEDIATOR
      아.꿈.사.
      LHS87
    • What is the Mediator?
      n. 중재인, 조정자, 매개자
      -From Naver Dictionary
      Communicationbetween
      object is encapsulatedwith a mediator object. Objects no longer communicate directly with each other, but instead communicate through the mediator.
      -From WIKIPEDIA
    • Terran Mediator
      가스 내놔
      일꾼내놔
      배틀크루져 줘
      자원 내놔
      병사가 될 사람을 줘
      전쟁 나갈 병사를 줘
      식량좀 줘
    • Structure
    • Example
    • Code
    • Code
    • What are the good point?
      reduces the dependencies between communicating objects
      thereby lowering the coupling
    • Thank you
    • SINGLETON
      아.꿈.사.
      LHS87
    • What is the Singleton?
      n. 하나씩 일어나는 일[것], 홀로인 것, 독자(獨子)
      -From Naver Dictionary
      In software engineering the singleton pattern is a design pattern that is used to restrict instantiation of
      a class to one object. This is useful when exactly one object is needed to coordinate actions across the system. The concept is sometimes generalized to systems
      that operate more efficiently when only one object exists, or that restrict the instantiation to a certain number of objects (say, five).
      -From WIKIPEDIA
    • Structure
    • Code
    • Combination
    • Thank you
    • MONOSTATE
      아.꿈.사.
      LHS87
    • What is the Monostate?
      mono- 《연결형》 「단일의; 단분자의;【화학】 1원자를 함유한」의 뜻(opp. poly-)
      -From Naver Dictionary
      The monostateenforces the behavior of
      a singleton without the structure of the monostate.
      그녀의 별명들…
      1.깝탱
      2.백설기
      3.탱
      4.탱구
      5.꼬꼬마리더태연
      6.때때
      7.젤리
      Symbolic link
    • Simple Code
    • What are the good points?
      1. 투명성, 사용자가 이 객체가 MONOSTATE라는 것을 알 필요가 없다.
      2. 파생가능성, 어떤 MONOSTATE의 파생 클래스는 같은 MONOSTATE의 일부
      3.다형성, 파생 클래스에서 같은 정적 변수의 집합에 대해 서로 다른 동작
      제공 가능
    • Singleton vsMonostate
      creating a single state
      that all of the instances use.
      limiting an object to
      a single instance of that object
      can't be instantiated via
      normal mechanisms.
      a different semantic
      to object instantiation
      but retains the same syntax.
      developers always know when
      they're dealing with a singleton
      Classes derived singleton classes
      are not singletons by default
      all classes derived from a monostate
      are monostates.
    • Thank you
    • NULL OBJECT
      아.꿈.사.
      LHS87
    • What is the Null object?
      provides intelligent do nothing behavior, hiding the details from its collaborators.
    • Structure
    • Code
    • What are the good points?
      makes client code simple. Clients can treat real collaborators
      and null collaborators uniformly. Clients normally don't know (and shouldn't care) whether they're dealing with a real or a null collaborator.
      makes the do nothing code in the null object easy to reuse. Multiple
      clients which all need their collaborators to do nothing will
      all do nothing the same way. If the do nothing behavior needs to be modified, the code can be changed in one place. Thereafter, all clients will continue to use the same do nothing behavior, which is now the modified do nothing behavior.
    • Thank you