Professional Documents
Culture Documents
LATAR BELAKANG
• Factory Method
• Abstract Factory Method
• Builder Pattern
• Prototype Pattern
• Singleton Pattern
Singleton Pattern
• dapat digunakan untuk memastikan bahwa hanya
ada sebuah instance suatu class yang diciptakan.
• Model Logic Singleton Pattern
Model untuk menggambarkan Singleton sangat
mudah dipahami karena hanya ada satu
Singleton instance. Client mengakses Singleton
instance melalui satu akses point yang diketahui.
Client dalam kasus ini adalah objek yang
membutuhkan akses untuk satu instance dari
Singleton.
Singleton Pattern(lanj..)
• Adapter
• Bridge
• Composite
• Decorator
• Façade
• Flyweight
• Proxy
Behavioral Pattern
• Observer
• Mediator
• Chain of Responsibility
• Template
• Interpreter
• Strategy
• Visitor
• State
• Command
• Iterator
How to Select & Use Design
Patterns
How to Select (> 20 in the book, and
still growing … fast?, more on
Internet)
• Scan Intent Sections
• Study How Patterns Interrelate
• Study Patterns of Like Purpose
• Examine a Cause of Redesign
• Consider What Should Be Variable in Your Design
How to Use
• Read the pattern once through for an
overview: appears trivial, but not
• Go back and study the structure,
participants, and collaborations sections
• Look at Sample Code: concrete example of
pattern in code
• Choose names for pattern participants
• Define the classes
• Define application specific names for
operations in the pattern
• Implement the operations to carry out the
responsibilities and collaborations in the
pattern
Yang perlu diingat adalah meskipun design
pattern itu adalah solusi yang umum,
design pattern tersebut hanyalah solusi
untuk satu masalah spesifik.