Sebastian Buczyński - Refactoring legacy Django app using OOP

Discover how to refashion your legacy Django app using object-oriented design, improving cohesion, code review, and quality, while leveraging patterns like MVP and Domain Driven Design.

Key takeaways
  • Code structure resembles a table in a restaurant, with no one right design.
  • Legacy codebases can benefit from refactoring, especially with object-oriented design.
  • Code is written for humans, not machines.
  • Refactoring improves cohesion by separating concerns.
  • Interfaces can simplify complex code and make it easier to use.
  • Patterns such as MVP (Model-View-Presenter) and Domain Driven Design can help structure code.
  • Code review and refactoring can improve design and reduce complexity.
  • Type hints and static code analysis with tools like mypy can improve code quality.
  • Refactoring can be an opportunity to improve design, not just a mandatory step.
  • Codebases can benefit from regular refactoring and testing.