the strategy pattern n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
The Strategy Pattern PowerPoint Presentation
Download Presentation
The Strategy Pattern

Loading in 2 Seconds...

play fullscreen
1 / 11

The Strategy Pattern - PowerPoint PPT Presentation


  • 105 Views
  • Uploaded on

The Strategy Pattern. Tujuan Pembelajaran. Mengetahui model persoalan yang menggunakan Strategy pattern Mengetahui pola Strategy pattern Mampu menerapkan Strategy pattern untuk meningkatkan fleksibilitas kode. Koleksi Desain Pattern. Creational Patterns : Singleton Factory

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'The Strategy Pattern' - sylvester-vinson


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
slide2

TujuanPembelajaran

Mengetahui model persoalan yang menggunakan Strategy pattern

Mengetahuipola Strategy pattern

Mampumenerapkan Strategy pattern untukmeningkatkanfleksibilitaskode

slide3

KoleksiDesain Pattern

  • Creational Patterns :
    • Singleton
    • Factory
  • Behavioural Patterns :
    • Strategy
slide4

Behavioural Patterns

Berkaitandengan “perilaku” objek

Mengidentifikasipolakomunikasiumumantarobjekdanmerealisasikanpola-polaini

Dapatmeningkatkanfleksibilitas

slide5

Persoalan

Program harusmendukungperilaku-perilaku yang berbedadariobjek-objek

slide6

OO Design Principles

Identify aspects that vary and separate them from what stays the same.

Program to an interface not an implementation.

Favor composition over inheritance

slide9

Strategy Pattern -- Definisi

The Strategy Pattern defines an interface for creating an object, but lets subclasses decide which class to instantiate. Factory Method lets a class defer instantiation to subclasses.

latihan
Latihan

Jikaterdapattambahansatujenis Duck, yaituDecoyDuck yang tidakbisaterbangdantidakbisamengeluarkansuara. Tuliskankode Java untukkelasDecoyDuck.

Jikasekarangperilakuberenang (swim) dibedakanmenjadiberenangdanmengambang, bagaimanakahperubahanstrukturkelasnya? Gambarkandengan class diagram. Tuliskankodeuntukkelas-kelas yang berubah.