Free module
Object-oriented design and design patterns
Learn object-oriented design hands on: classes, inheritance, composition, design principles and common design patterns in Python.
The lessons
Each lesson is free to read in full. Create a free account to run its commands in a live lab and to sit its quizzes and tasks.
1 · Virtual machine lab
Classes and objects in Python
I can model a thing as a class with state and behaviour.
Read the lesson2 · Virtual machine lab
Inheritance and polymorphism
I can reuse code through inheritance and use polymorphism.
Read the lesson3 · Virtual machine lab
Composition over inheritance
I can choose composition over inheritance and say why.
Read the lesson4 · Virtual machine lab
Object-oriented design principles
I can spot code that gives a class two jobs or is hard to extend.
Read the lesson5 · Virtual machine lab
Factory, strategy and decorator patterns
I can apply a factory, a strategy and a decorator.
Read the lesson6 · Virtual machine lab
Observer and state patterns
I can apply the observer and state patterns.
Read the lesson
Worked in a real lab
Every lesson of this module is worked in a lab started for you alone. The labs it uses:
Teaching a class? Set this module for your students with a teacher guide, marked assignments and a lab for every student.