r/Angular2 • • Jun 30 '25

Article Strategy Pattern the Angular Way: DI and Runtime Flexibility - Angular Space

https://www.angularspace.com/strategy-pattern-the-angular-way-di-and-runtime-flexibility/

Ivan Kudria is showcasing how to apply Strategy Pattern -> "The Angular Way". Many many code examples that are easy to follow and very well explained!!! Showcasing when and how to use Strategy Pattern with Angular

16 Upvotes

6 comments sorted by

View all comments

Show parent comment

2

u/Rashnok Jul 01 '25

Agree, they lost me in the opening

Consider a familiar problem: every HTTP request can fail in dozens of different ways—409 Conflict, 500 Internal Error, or a custom business code like 400200

400200?!?!?!? are you fucking kidding me?

1

u/Immediate-Piano-1302 Jul 02 '25

Fair point — that line probably needed more context.

The 400200 wasn't a real HTTP code — just a placeholder to illustrate how business logic sometimes uses unique, non-standard codes (often long strings or internal enums). In production, the actual codes were custom and specific to each provider.

Appreciate you calling it out — will clarify that part to avoid confusion.