Locked learning resources

Join us and get access to thousands of tutorials and a community of expert Pythonistas.

Unlock This Lesson

Locked learning resources

This lesson is for members only. Join us and get access to thousands of tutorials and a community of expert Pythonistas.

Unlock This Lesson

Implementing the Factory Method Pattern in Python (Summary)

Factory Method is a widely used, creational design pattern that can be used in many situations where multiple concrete implementations of an interface exist.

The pattern removes complex logical code that is hard to maintain, and replaces it with a design that is reusable and extensible. The pattern avoids modifying existing code to support new requirements.

This is important because changing existing code can introduce changes in behavior or subtle bugs.

In this video course, you learned:

  • What the Factory Method design pattern is and what its components are
  • How to refactor existing code to leverage Factory Method
  • Situations in which Factory Method should be used
  • How Object Factories provide more flexibility to implement Factory Method
  • How to implement a general purpose Object Factory and its challenges
  • How to specialize a general solution to provide a better context

Locked learning resources

Join us and get access to thousands of tutorials and a community of expert Pythonistas.

Unlock This Lesson

Already a member? Sign-In

Locked learning resources

The full lesson is for members only. Join us and get access to thousands of tutorials and a community of expert Pythonistas.

Unlock This Lesson

Already a member? Sign-In

00:00 Congratulations, you have reached the end of this course. You’ve been on a long journey where you went from conditional code to a basic and then an advanced implementation of the Factory Method pattern.

00:15 You’ve learned how to implement the components of the Factory Method pattern that was the client code, and the creator, and the factory method and then the products, and you improved the design of existing code by applying the Factory Method pattern.

00:32 You’ve also learned how to select an appropriate implementation of the Factory Method pattern. Remember, you went through a number of iterations where you gradually improved the code, and so now you can select which of those levels of improvement you would apply to your particular projects.

00:53 So thank you for going on this journey. I’ve really enjoyed being on this journey with you, and I would encourage you to check out some of the links here.

01:02 That will give you a lot of extra background. For example, there is the tutorial on which this video course is based. It’s The Factory Method Pattern and Its Implementation in Python.

01:14 There’s actually more information in that tutorial. Then there are Python classes. Of course, you have used classes throughout this course extensively. There was also mention of the use of underscores, there was the implementation of the YAML format.

01:32 Then you learned about data classes, abstract base classes, and Python protocols. So that’s a lot of good content for you to get stuck into.

01:45 So thank you for watching, and I hope to come across you again in one of the next courses.

Become a Member to join the conversation.