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
180
0
Share
Clean Architecture - PythonRio
Presentation about clean architecture and python at last meetup of PythonRio.
Andre Fonseca
December 10, 2016
More Decks by Andre Fonseca
See All by Andre Fonseca
Quando banco de dados atrapalha
aoqfonseca
0
77
Python e a inteligência coletiva
aoqfonseca
0
85
Micro serviços e dados distribuidos
aoqfonseca
1
140
Data Dichotomy
aoqfonseca
0
26
Code Review - Fazendo de um jeito eficaz
aoqfonseca
0
140
Padrões e Anti Padrões de Estabilidade
aoqfonseca
2
120
Other Decks in Technology
See All in Technology
AWS運用におけるAI Agent活用術 / JAWS-UG 神戸 #11 LT大会
genda
1
280
セキュリティ対策、何からはじめる? CloudNative環境の脅威モデリングと リスク評価実践入門 #cloudnativekaigi
varu3
5
980
React Compiler導入から21ヶ月、いま始めるならこうやる
astatsuya
2
200
毎日の作業を Claude Code 経由にしたら、 ノウハウがコードになった
kossykinto
1
1.4k
20260515 ⾃分のアカウントとプライバシーを守る認証と認可の話〜利⽤者向け〜
oidfj
0
660
Tachikawa.any 運営挨拶
daitasu
0
180
R&D 祭 2024 UE5で絵コンテ・作画の制作支援ツールをつくる話
olmdrd
PRO
0
170
サンプリングは「作る」のか「使う」のか? 分散トレースのコストと運用を両立する実践的戦略 / Why you need the tail sampling and why you don't want it
ymotongpoo
4
190
"スキルファースト"で作る、AIの自走環境
subroh0508
0
560
サイボウズ、プラットフォームエンジニアリング始めるってよ ― プラットフォームチームの事業貢献と組織アラインメントの強化
ueokande
0
120
AI対話分析の夢と、汚いデータの現実 Looker / Dataplex / Dataform で実現する品質ファーストな基盤設計
waiwai2111
0
610
Purview Endpoint DLP 動かしてみた
kozakigh
0
440
Featured
See All Featured
Between Models and Reality
mayunak
4
290
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.8k
Exploring anti-patterns in Rails
aemeredith
3
360
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
65
54k
Ruling the World: When Life Gets Gamed
codingconduct
0
230
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
350
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
Visualization
eitanlees
151
17k
For a Future-Friendly Web
brad_frost
183
10k
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
160
New Earth Scene 8
popppiees
3
2.2k
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.