HackerTube
HomeLongsLikedHistoryWatch laterCategoriesPlaylistsSettings

The Clean Architecture in Python

Next Day Video5 HN recommenders · recommended in 6 months, 2017-2021
YouTube
114K views · 12 years ago · talk · evergreen

Brandon Rhodes' PyOhio 2014 talk on applying the Clean Architecture in Python. He shows how this high-level design pattern fits Python's features and addresses maintainability problems in large applications.

HN points to it as a practical way to separate business logic from I/O, which reduces mocking and underlies the functional core, imperative shell idea.

Software architecture & designPython, Ruby & scripting languagesTesting, debugging & developer tools#cleanarchitecture#python#brandonrhodes#functionalcore#testing

7 comments from Hacker News

@hprotagonist2021 · in “It's probably time to stop recommending Clean Code (2020)”

"Promote I/O to management (where it can't do any damage)" is the actionably good thing i've taken from Brandon Rhoades' talk based on this: ▶ this video Living in a world where people regularly write single functions that: 1. loads data from a hardcoded string path of file location 2. does all the analysis inside the same loop that the file content iteration happens in and 3. plots the results ... that cleavage plane is a meaningfully good one. The rest of the ideas fall into "all things in moderation, including moderation", and can and should be special-cased judiciously as long as you know what you're doing. But oh god please can we stop writing _that_ function already.

RecommendsView on HN
@travisjungroth2021 · in “My Python testing style guide (2017)”

I'd really recommend this video. I had seen it years ago and just came back to it. It's about changing your architecture, one of the effects of that being changing how you need/use mock. ▶ this video

Strongly recommendsView on HN
@aszen2020 · in “Prefer Fakes over Mocks”

I have been researching into several testing approaches and so far in my experience yes fakes are better than mocks. But what is even better is not having to fake or mock stuff especially for testing business logic. One of the problems we get ourselves into is abstracting service io code into functions and calling them from our business logic code. This forces us to mock all the io calls, instead we should be doing the opposite i.e abstracting business logic into discrete functions of pure data in and out and then calling those functions from our io code. This way we can test the business logic independently of the io code. Testing the business logic now becomes quite simple and one can leverage property testing to further boost our confidence in such tests. Many times the ramaining io code is just calling other functions and doesn't need to be tested. Several other ideas that relate to this are hexagonal architecture, Domain Driver Design, clean architecture and functional core with an imperative shell. Some resources to further explore these ideas: Clean Architecture in Python - ▶ this video Why integrated tests are a scam - link Boundaries - link

CitesView on HN
@samrohn2019 · in “Ask HN: What are some of the best Python related talks that you have watched”

These are some of my favorites: Clean Architectures in python: ▶ this video Pandas from ground up: link How to write actually object-oriented python: link It's Time to Learn Regular Expressions: link

RecommendsView on HN
@ceronman2018 · in “Functional core, imperative shell (2012)”

This is the same principle of the Clean Architecture. I like how Brandon Rhodes explain how to apply it in Python: ▶ this video

RecommendsView on HN
@chubot2017 · in “A theory of modern Golang”

I was going to write that I don't have a good pointer, but actually I think the idea is basically the "onion architecture" or "clean architecture". I don't recall if I watched all of this talk, but in general I like Brandon Rhodes' PyCon talks : ▶ this video link I don't come from a Java background, but I think that many of these ideas originated in the Java community. They came to Python later (if at all), and it's a little funny to see Go struggling with the same thing. I think I came at it from more of a functional programming perspective, and the style gradually converged with what people were thinking about OOP. I'm not actually of all the details about "clean architecture" and "onion architecture", but they are definitely related to dependency injection. Basically all your effects and state can be instantiated on the "outside" in main() and passed INWARD. But I don't believe it necessarily has to be pure. I encapsulate all my state, but I don't encapsulate all my side effects, like printing to the screen. Some people appeared to like this comment, which is somewhat related: link I'm not sure how much this will help, but here is 12K+ lines of code I wrote with zero globals: link The main directories to look at are core/ and osh/. The main program imports a lot of stuff and wires it together: link (There is a bunch of surface messiness, but the architecture is sound.) I've also written even larger programs with zero globals. Also, I believe that web frameworks are some

RecommendsView on HN
@ceronman2017 · in “The Clean Architecture (2012)”

For the Python programmers, there is also a better explanation of the same concept by Brandon Rhodes: The Clean Architecture in Python. ▶ this video

RecommendsView on HN
Ruby Conf 12 - Boundaries by Gary Bernhardt45:55

Ruby Conf 12 - Boundaries by Gary Bernhardt

Confreaks
58K views • 13 years ago
October CincyRb - Jim Weirich on Decoupling from Rails1:15:58

October CincyRb - Jim Weirich on Decoupling from Rails

Launch Scout
48K views • 13 years ago
Stop Writing Classes27:29

Stop Writing Classes

Next Day Video
962K views • 14 years ago
Scalability at YouTube38:43

Scalability at YouTube

Next Day Video
51K views • 14 years ago
Cory Benfield - Building Protocol Libraries The Right Way - PyCon 201631:38

Cory Benfield - Building Protocol Libraries The Right Way - PyCon 2016

PyCon 2016
15K views • 10 years ago
Functional architecture - The pits of success - Mark Seemann1:00:10

Functional architecture - The pits of success - Mark Seemann

NDC Conferences
152K views • 10 years ago
Ruby Midwest 2011 - Keynote: Architecture the Lost Years by Robert Martin1:06:39

Ruby Midwest 2011 - Keynote: Architecture the Lost Years by Robert Martin

Confreaks
172K views • 14 years ago
The Forgotten Art of Structured Programming - Kevlin Henney [C++ on Sea 2019]1:29:27

The Forgotten Art of Structured Programming - Kevlin Henney [C++ on Sea 2019]

cpponsea
245K views • 7 years ago
Stuart Sierra - Components Just Enough Structure41:19

Stuart Sierra - Components Just Enough Structure

ClojureTV
36K views • 12 years ago
Armin Ronacher - A Python for Future Generations42:44

Armin Ronacher - A Python for Future Generations

EuroPython Conference
6K views • 9 years ago
Effective Programs - 10 Years of Clojure - Rich Hickey1:14:52

Effective Programs - 10 Years of Clojure - Rich Hickey

ClojureTV
176K views • 9 years ago
Solving Problems the Clojure Way - Rafal Dittwald1:02:26

Solving Problems the Clojure Way - Rafal Dittwald

Clojure/north
87K views • 7 years ago
Google Developers Day US - Python Design Patterns44:03

Google Developers Day US - Python Design Patterns

GoogleDeveloperDay
90K views • 19 years ago
Raymond Hettinger, Keynote on Concurrency, PyBay 20171:13:53

Raymond Hettinger, Keynote on Concurrency, PyBay 2017

SF Python
161K views • 9 years ago
Visualising software architecture with the C4 model - Simon Brown, Agile on the Beach 201935:33

Visualising software architecture with the C4 model - Simon Brown, Agile on the Beach 2019

Agile on the Beach
553K views • 7 years ago
MountainWest RubyConf 2014 - But Really, You Should Learn Smalltalk28:06

MountainWest RubyConf 2014 - But Really, You Should Learn Smalltalk

Confreaks
27K views • 12 years ago
The Principles of Clean Architecture by Uncle Bob Martin1:13:24

The Principles of Clean Architecture by Uncle Bob Martin

NorfolkDevelopers
591K views • 10 years ago
How To Design A Good API and Why it Matters1:00:19

How To Design A Good API and Why it Matters

Google TechTalks
453K views • 19 years ago
Nicholas Zakas: Scalable JavaScript Application Architecture52:23

Nicholas Zakas: Scalable JavaScript Application Architecture

YUI Library
68K views • 15 years ago
How Python was Shaped by leaky Internals, Armin Ronacher, Flask framework49:55

How Python was Shaped by leaky Internals, Armin Ronacher, Flask framework

Видео с мероприятий {speach!
20K views • 10 years ago