Serghei Pogor
Mar 18, 2024

--

Absolutely right, and thanks for pointing that out!

My main goal here was just to show how factory patterns work in a simple way.

That's why I didn't separate the factories for each payment gateway.

It was all about keeping things easy to understand this time. But you're spot on - using separate factories is a smarter move for adding new gateways without changing old code.

It's something to explore more in the future for sure.

Appreciate your insight!

--

--

Serghei Pogor
Serghei Pogor

Written by Serghei Pogor

Good code is its own best documentation

No responses yet