English Reference

Word

strategy pattern

Definition

compound. a way of writing computer code that lets you choose between different methods for doing a task while the program is running. Instead of using one fixed method, you can swap in a new one easily.

compound. a behavioural design pattern that enables selecting an algorithm's behaviour at runtime. It defines a family of algorithms, encapsulates each one, and makes them interchangeable, allowing the algorithm to vary independently from clients that use it.

Examples

“The app uses the strategy pattern to switch between different payment methods.”

“By implementing the strategy pattern, the developers allowed the navigation software to switch between 'fastest route' and 'shortest distance' logic without changing the core code.”

“The strategy pattern promotes the Open/Closed Principle by allowing new algorithms to be introduced into a system without necessitating modifications to the existing context class that consumes them.”

Examples

simple

“The app uses the strategy pattern to switch between different payment methods.”

contextual

“By implementing the strategy pattern, the developers allowed the navigation software to switch between 'fastest route' and 'shortest distance' logic without changing the core code.”

complex

“The strategy pattern promotes the Open/Closed Principle by allowing new algorithms to be introduced into a system without necessitating modifications to the existing context class that consumes them.”

Usage

Commonly used in object-oriented programming; typically involves an interface for the strategy and concrete classes for each specific implementation.

Etymology

A compound of the military-derived strategy, from the Greek stratēgia, and pattern. The term was formalised in the software engineering context by Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides in 1994.

Etymology adapted from Wiktionary, available under CC BY-SA 4.0.

Domain

Software Architecture

This entry

Exam level
CambridgeCambridgeCambridge English QualificationsThe exam suite from Cambridge University Press & Assessment, from A1 Movers up to C2 Proficiency. The benchmark names double as CEFR labels.C1 AdvancedIELTSIELTSInternational English Language Testing SystemThe 0–9 band test co-owned by the British Council, IDP, and Cambridge. Used for university entry, work, and migration.7.0–8.0TOEFL iBTTOEFL iBTTest of English as a Foreign Language, Internet-Based TestETS's academic English test, the standard route for US university admissions. Scored 0–120, with a 1–6 scale since 2026.1–6 scale: 5.0–5.595–113TOEICTOEICTest of English for International CommunicationETS's workplace English test, big in Japan and Korea. Listening & Reading scores 10–990 and tops out at C1.945–990EikenEikenTest in Practical English ProficiencyThe English proficiency test from the Eiken Foundation of Japan, widely taken by Japanese students. Grades run from 5 to 1, with Pre-1 and Pre-2 between them.Grade 1
Level
C1 · Advanced
Updated

QR code

englishreference.com/q/strategy-pattern

English Reference