Python Interfaces: Object-Oriented Design Principles (Overview)

Interfaces play an important role in software engineering. As an application grows, updates and changes to the code base become more difficult to manage. More often than not, you wind up having classes that look very similar but are unrelated, which can lead to some confusion. In this video course, you’ll see how you can use a Python interface to help determine what class you should use to tackle the current problem.

In this video course, you’ll be able to:

  • Understand how interfaces work and the caveats of Python interface creation
  • Comprehend how useful interfaces are in a dynamic language like Python
  • Implement an informal Python interface
  • Use abc.ABCMeta and @abc.abstractmethod to implement a formal Python interface
Download

Course Slides (.pdf)

3.0 MB
Download

Sample Code (.zip)

4.2 KB

00:00 Python Interfaces: Object-Oriented Design Principles

00:05 Interfaces play an important role in software engineering. As an application grows, updates and changes to the code base become more difficult to manage. More often than not, you wind up having classes that look very similar, but are unrelated, which can lead to confusion.

00:21 Here, you’ll see how you can use a Python interface to help determine what class you should use to tackle the current problem.

00:29 In this course, you’ll understand how interfaces work and the caveats of Python interface creation, comprehend how useful interfaces are in a dynamic language such as Python, implement an informal Python interface and implement a formal Python interface using Python’s ABC class. Interfaces in Python are handled differently than most other languages, and they can vary in their design complexity.

00:56 By the end of this course, you’ll have a better understanding of aspects of Python’s data model, as well as how interfaces in Python compare to those in other languages such as Java, C++, and Go.

01:09 Any code that you see running in the REPL will be using the Bpython interpreter. This is a replacement Python interpreter that offers a number of enhancements, including code highlighting and suggestions, but any code you see running on screen will work in the standard Python REPL, which is typically accessed by typing python or python3 at your terminal or command line prompt.

01:31 So now you know what’s going to be covered. Let’s get started.

Become a Member to join the conversation.