Tagged “Strategy”
3 articles with this tag.
- Compound patterns and MVCPatterns rarely appear alone. How Model-View-Controller combines Observer, Strategy and Composite, how Spring MVC maps the idea to the web, MVC versus MVP and MVVM, and other common pattern combinations in real code.
- StrategyDefine a family of interchangeable algorithms behind one interface and choose between them at runtime — with a runnable Java 21 discount-calculation example, UML, trade-offs and interview questions.
- Strategy vs State vs Template MethodThree patterns that all vary behaviour: Strategy swaps a whole algorithm by composition, State swaps behaviour as an object's lifecycle changes, and Template Method varies steps by inheritance. Side-by-side code, the deciding questions and how to choose.