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
Clean Architecture - PythonRio
Search
Andre Fonseca
December 10, 2016
Technology
0
170
Clean Architecture - PythonRio
Presentation about clean architecture and python at last meetup of PythonRio.
Andre Fonseca
December 10, 2016
Tweet
Share
More Decks by Andre Fonseca
See All by Andre Fonseca
Quando banco de dados atrapalha
aoqfonseca
0
72
Python e a inteligência coletiva
aoqfonseca
0
79
Micro serviços e dados distribuidos
aoqfonseca
1
130
Data Dichotomy
aoqfonseca
0
21
Code Review - Fazendo de um jeito eficaz
aoqfonseca
0
130
Padrões e Anti Padrões de Estabilidade
aoqfonseca
2
120
Other Decks in Technology
See All in Technology
整頓のジレンマとの戦い〜Tidy First?で振り返る事業とキャリアの歩み〜/Fighting the tidiness dilemma〜Business and Career Milestones Reflected on in Tidy First?〜
bitkey
2
14k
20250707-AI活用の個人差を埋めるチームづくり
shnjtk
4
3.6k
作曲家がボカロを使うようにPdMはAIを使え
itotaxi
0
440
LangSmith×Webhook連携で実現するプロンプトドリブンCI/CD
sergicalsix
1
200
KubeCon + CloudNativeCon Japan 2025 Recap Opening & Choose Your Own Adventureシリーズまとめ
mmmatsuda
0
260
KubeCon + CloudNativeCon Japan 2025 に行ってきた! & containerd の新機能紹介
honahuku
0
120
Claude Code に プロジェクト管理やらせたみた
unson
4
2.3k
改めてAWS WAFを振り返る~業務で使うためのポイント~
masakiokuda
2
240
【5分でわかる】セーフィー エンジニア向け会社紹介
safie_recruit
0
27k
Should Our Project Join the CNCF? (Japanese Recap)
whywaita
PRO
0
330
American airlines ®️ USA Contact Numbers: Complete 2025 Support Guide
airhelpsupport
0
350
AIとともに進化するエンジニアリング / Engineering-Evolving-with-AI_final.pdf
lycorptech_jp
PRO
0
160
Featured
See All Featured
The Art of Programming - Codeland 2020
erikaheidi
54
13k
GraphQLの誤解/rethinking-graphql
sonatard
71
11k
Reflections from 52 weeks, 52 projects
jeffersonlam
351
20k
The Language of Interfaces
destraynor
158
25k
How GitHub (no longer) Works
holman
314
140k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
15
1.5k
Balancing Empowerment & Direction
lara
1
420
Practical Orchestrator
shlominoach
188
11k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
248
1.3M
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
126
52k
Site-Speed That Sticks
csswizardry
10
680
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
229
22k
Transcript
CLEAN ARCHITECTURE NOVIDADES - PRINCÍPIOS - DESIGN - SIMPLICIDADE -
PYTHON
15+ anos Sr System Engineer at Bemobi / Opera github.com/aoqfonseca
@aoqfonseca
ARCHITECTURE
REACT / ANGULAR JS WEBSOCKET JSON NGINX CIRCUS TORNADO /
FLASK / DJANGO MYSQL / MONGO / POSTGRES
None
None
DESIGN PATTERNS
http://www.123rf.com/photo_11204982_conceptual-vector-illustration-adult-businessman-and-question-marks-inside-his-head-choice- problems.html
ARCHITECTURE CLEAN
None
UNCLE BOB
https://en.wikipedia.org/wiki/SOLID_(object-oriented_design) Source: http://team-coder.com/tag/clean-code/
https://8thlight.com/blog/uncle-bob/2012/08/13/the-clean- architecture.html https://8thlight.com/blog/uncle-bob/2011/11/22/Clean- Architecture.html
http://www.electronicbeats.net/the-feed/watch-how-moby-and-david-bowie-describe-the-internet-in-1995/
The WEB is just one of many ways to delivery
Many of ours truths (guide lines) are based on problems
that doesn’t exists anymore.
• Uncoupled • Allow to delay choices and decisions about
using some techies (ex: database, libs, etc) • Easy to evolve (add features, change behaves) • Solution and propose at first view • Domain more important than libs / frameworks
None
# -*- coding: utf-8 -*- import requests def main(word): url
= “http://api.duckduckgo.com/?q={}&format=json&pretty=1” url = url.format(word) response = requests.get(url) # io results = response.json()[‘Results’] # io print results
def build_url(word): url = “http://api.duckduckgo.com/?q={}&format=json” return url.format(word) def find(url): response
= requests.get(url) return response def process_result(response): json = response.json() return json.get(’Results’, []) def main(word): url = build_url(word) response = find(url) print process_result(response)
Listen your TESTS
None
https://8thlight.com/blog/uncle-bob/2012/08/13/the-clean-architecture.html
Use Manager, Repository, etc…. They aren’t forbiden
Model Centralized
Model DATABASE Centralized
None
Python has great data structures and ways to manipulate them.