---
title: "Discussion on \"Design Patterns Simplified #2: Factory Method\" | Hashnode"
description: "Discussion on \"Design Patterns Simplified #2: Factory Method\". Why does my checkout code have five if/else blocks just to pick a payment gateway?"
url: "https://hashnode.com/posts/design-patterns-simplified-2-factory-method/6aa007b56442f32e071568a5"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Design Patterns Simplified #2: Factory Method](https://onkeshgupta.hashnode.dev/design-patterns-simplified-2-factory-method?utm_source=hashnode&utm_medium=feed)

Why does my checkout code have five if/else blocks just to pick a payment gateway?

Sep 8 · 9 min read · onkeshgupta.hashnode.dev  
Updated Sep 13  
Read the article

-   [#design-patterns](https://hashnode.com/tag/design-patterns)
-   [#factory-design-pattern](https://hashnode.com/tag/factory-design-pattern)
-   [#software-engineering](https://hashnode.com/tag/software-engineering)
-   [#system-design](https://hashnode.com/tag/system-design)
-   [#clean-code](https://hashnode.com/tag/clean-code)
-   [#cpp](https://hashnode.com/tag/cpp)

## Written by

[Onkesh Gupta](https://hashnode.com/@onkeshgupta)

@onkeshgupta · Delhi, India

  
[View profile](https://hashnode.com/@onkeshgupta)

Breaking Systems. Learning Why. Building Better.

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
