Overview
Syllabus
Intro
Refactoring improving the design af odsting code
Refactoring is a journey
No Refactoring
Big-Bang rewrite != refactoring
The best moment to refactor? Right before implementing a new feature
@staticmethod considered a code smell
how could this happen?
Essential complexity No way to escape - one needs to manage it
Writing classes != OOP
Cells creating an organism
Community members
Actors performing a play
Inheritance Composition Encapsulation Abstraction Polymorphism
Roles Responsibilities Collaborations
Where to put that code?
Role Stereotypes
Tell, Don't Ask
Information Holder model Structurer Service Provider Coordinator signal handler Controller Interfacer
1. Introduce Interfacers 2. Consolidate Controller role 3. Strip side effects off Information Holders
Heuristics not commandments
No long refactoring journeys Do it daily
Taught by
EuroPython Conference