Skip to content

An Implementation of Factory Design Pattern in Python. It does not use static calling of subclasses but rather automatically gets the name of the concrete class as keys to invoke the factory creator. This uses Open-Close principle in an automated way, thus making development much easier and adding more payment methods

Notifications You must be signed in to change notification settings

DanielOX/factory-design-pattern

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Class Diagram of Implemented Design Pattern

Factory Design Pattern The Factory Design Pattern is a creational design pattern that provides an interface for creating objects in a super factory method. It allows you to create objects without specifying the exact class of the object that will be instantiated. The pattern promotes loose coupling and flexibility in your codebase.

I have used 3 concrete classes

  • GooglePayPayment
  • PayPalPayment
  • CreditCardPayment

Which is being utilised by the creator class PaymentFactory to generate class the relevant subclasses.

  • It promotes the Open-Closed Responsibility Principle
  • It promotes Single Responsibility Principle

About

An Implementation of Factory Design Pattern in Python. It does not use static calling of subclasses but rather automatically gets the name of the concrete class as keys to invoke the factory creator. This uses Open-Close principle in an automated way, thus making development much easier and adding more payment methods

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages