Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Design pattern Adapter
Search
Lucas Hiago de Moura Vilela
September 02, 2019
Programming
0
27
Design pattern Adapter
This is a little talk about the design pattern Adapter
Lucas Hiago de Moura Vilela
September 02, 2019
Tweet
Share
More Decks by Lucas Hiago de Moura Vilela
See All by Lucas Hiago de Moura Vilela
SQL com Arel no Rails
luchiago
0
15
Brown Bag - Aplicação mobile de vídeo-chamadas
luchiago
0
42
Gitpod
luchiago
1
58
Introduction to Scrapy
luchiago
0
28
Other Decks in Programming
See All in Programming
Git Rebase
bkuhlmann
11
1.6k
Goのmultiple errorsについて (2024年4月版)
syumai
4
1.2k
PHPの次期バージョンはこの時期どうなっているのか - Internalsの開発体制について - PHPカンファレンス小田原
youkidearitai
PRO
1
220
単体テストを書かない技術 #phpcon_odawara
o0h
PRO
27
8.5k
SIMD Parallel Programming with the Vector API
josepaumard
0
230
FigmaとPHPで作る1ミリたりとも表示崩れしない最強の帳票印刷ソリューション
ttskch
43
19k
Milestoner
bkuhlmann
1
410
Elm 0.19.0 Changes
bkuhlmann
0
510
GitLab CI/CD で C#/WPFアプリケーションのテストとインストーラーのビルド・デプロイを自動化する
hacarus
0
230
Elm Form Validation
bkuhlmann
0
510
Site Reliability Engineering for GMO
pyama86
8
1.1k
Azure OpenAI Serviceのプロンプトエンジニアリング入門
tomokusaba
3
870
Featured
See All Featured
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
33
6k
4 Signs Your Business is Dying
shpigford
176
21k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
222
21k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
14
1.5k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
126
32k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
358
22k
Build The Right Thing And Hit Your Dates
maggiecrowley
25
2k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
242
1.2M
VelocityConf: Rendering Performance Case Studies
addyosmani
321
23k
Practical Orchestrator
shlominoach
183
9.7k
Documentation Writing (for coders)
carmenintech
61
4k
Debugging Ruby Performance
tmm1
70
11k
Transcript
Adapter Padrão de Projeto Estrutural
Padrão de Projeto Estrutural • Definição ◦ Preocupação com a
forma • De classe ◦ Utilização da herança • De objetos ◦ Descrever maneiras de compor novos objetos DASDSDSA
Adapter • Também conhecido como Wrapper • Padrão de projeto
de Classe • Motivação: reaproveitar uma classe
Objetivo • Converter interface • “Traduzir” solicitações • Permitir comunicação
entre interfaces incompatíveis
Aplicação • Utilizado quando: ◦ Se deseja utilizar uma classe
existente ◦ Criar classes reutilizáveis ◦ Para adaptar interface da classe mãe de subclasses
Diagrama UML • Client: Colabora com os objetos em conformidade
com a interface Target • Target: Define a interface do domínio específico que o cliente utiliza • Adapter: Adapta a interface Adaptee para a interface da classe Target • Adaptee: Define uma interface existente que necessita ser adaptada
Consequências • Adapter concreto e as classes e subclasses adaptadas
• Substituição de algum comportamento da classe adaptada • Complexidade
Código