Adapter Pattern
Upcoming SlideShare
Loading in...5
×
 

Adapter Pattern

on

  • 178 views

Adapter Pattern

Adapter Pattern

Statistics

Views

Total Views
178
Views on SlideShare
174
Embed Views
4

Actions

Likes
0
Downloads
1
Comments
0

1 Embed 4

http://www.slideee.com 4

Accessibility

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

Adapter Pattern Adapter Pattern Presentation Transcript

  • Adapter Pattern Ted
  • • 將一個類別的介面轉換成客戶希望的另外 一個介面。Adapter模式使原本由於介面不 相容而不能一起工作的類別可以一起工作
  • Shape Rectangle Triangle
  • Shape Void display() Rectangle Void display() Triangle Void display() Third-Party Circle Void ShowCircle() • 顯示圖型的方法不同 • 類別不同 Shape vs IShap IShap Void ShowCircle()
  • • 物件Adapter模式 • 類別Adapter模式
  • Facade vs Adapter Facade Adapter 是否存在既有類別 是 是 是否必須依某個介面設計 否 是 物件需要多型行為 否 可能 需要更簡單的行為 是 否
  • • Adapter模式 將一個或多個類別的介面轉換 成我們需要類別所具備的介面