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
150
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
63
Python e a inteligência coletiva
aoqfonseca
0
74
Micro serviços e dados distribuidos
aoqfonseca
1
120
Data Dichotomy
aoqfonseca
0
16
Code Review - Fazendo de um jeito eficaz
aoqfonseca
0
120
Padrões e Anti Padrões de Estabilidade
aoqfonseca
2
110
Other Decks in Technology
See All in Technology
Reducing Cross-Zone Egress at Spotify with Custom gRPC Load Balancing Recap
koh_naga
0
150
Cloud Native Java with Spring Boot (CNCF Aarhus, April 2024)
thomasvitale
1
130
VS CodeでAWSを操作しよう
smt7174
3
260
マルチアカウント環境への発見的統制の導入
ch1aki
1
1.3k
シン・Kafka / shin-kafka
oracle4engineer
PRO
8
2.7k
Aurora MySQL v3(MySQL8.0互換)の オンラインDDLの罠挙動を全バージョンで検証した
yutakikai
1
150
[2024年3月版] Databricksのシステムアーキテクチャ
databricksjapan
8
1.9k
入社後初めてのタスクでk8sアップグレードした話.pdf
kkato1
1
380
コンパウンドスタートアップのためのスケーラブルでセキュアなInfrastructure as Codeパイプラインを考える / Scalable and Secure Infrastructure as Code Pipeline for a Compound Startup
yuyatakeyama
3
3.8k
「手動オペレーションに定評がある」と言われた私が心がけていること / phpcon_odawara2024
blue_goheimochi
2
320
NgRx Signal Store
rainerhahnekamp
0
130
オーナーシップを持つ領域を明確にする
konifar
12
2.7k
Featured
See All Featured
Statistics for Hackers
jakevdp
789
220k
Writing Fast Ruby
sferik
620
60k
Designing Experiences People Love
moore
136
23k
Reflections from 52 weeks, 52 projects
jeffersonlam
344
19k
Design by the Numbers
sachag
274
18k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
39
4.4k
From Idea to $5000 a Month in 5 Months
shpigford
377
45k
Fireside Chat
paigeccino
20
2.6k
Rebuilding a faster, lazier Slack
samanthasiow
72
8.2k
StorybookのUI Testing Handbookを読んだ
zakiyama
11
4.6k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
1
3.4k
Automating Front-end Workflow
addyosmani
1355
200k
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.