Skip to content

Instantly share code, notes, and snippets.

@DaSchTour
DaSchTour / typescript-strategy-and-factory-patterns.ts
Last active October 19, 2022 17:12 — forked from shershen08/typescript-strategy-and-factory-patterns.ts
Strategy and factory patterns in TypeScript
// see article with examples in JAVA here: https://dzone.com/articles/design-patterns-the-strategy-and-factory-patterns
// example for educational purposes shownig close and mature syntax of modern TypeScript
enum AccountTypes {CURRENT, SAVINGS, HIGH_ROLLER_MONEY_MARKET, STANDARD_MONEY_MARKET}
////////////////////////////////////////
/// the interface that is used by the strategy
////////////////////////////////////////
interface InterestCalculationStrategy {