Strategy (design pattern)
E679880
Strategy is a behavioral design pattern that defines a family of interchangeable algorithms, encapsulates each one, and lets clients switch between them at runtime without changing their code.
All labels observed (2)
| Label | Occurrences |
|---|---|
| Strategy (design pattern) canonical | 1 |
| Strategy pattern | 1 |
How this entity was disambiguated
This entity first appeared as the object of triple T7665785 — resolving that mention is where its identity was fixed. The disambiguator weighed these candidate entities and picked the highlighted one (or “None”, minting a new entity). This is how homonymy is resolved: the same surface form can point to different entities.
Target entity: Strategy (design pattern) Context triple: [State (design pattern), relatedTo, Strategy (design pattern)]
-
A.
Template Method
Template Method is a behavioral design pattern that defines the skeleton of an algorithm in a base class while allowing subclasses to override specific steps without changing the algorithm’s overall structure.
-
B.
Design Patterns: Elements of Reusable Object-Oriented Software
Design Patterns: Elements of Reusable Object-Oriented Software is a seminal software engineering book by the "Gang of Four" that catalogues foundational object-oriented design patterns widely used in software development.
-
C.
Chain of Responsibility
Chain of Responsibility is a behavioral design pattern that decouples senders and receivers by passing a request along a chain of potential handlers until one of them processes it.
-
D.
Dependency Inversion Principle
The Dependency Inversion Principle is an object-oriented design guideline that promotes decoupling by having high-level and low-level modules depend on shared abstractions rather than concrete implementations.
-
E.
The Design
"The Design" is a lesser-known work associated with American actress and writer Betsy Drake, reflecting her creative pursuits beyond her film career.
- F. None of above. chosen
- G. Unsure - the case is ambiguous/there is not enough information to decide.
Target entity: Strategy (design pattern) Target entity description: Strategy is a behavioral design pattern that defines a family of interchangeable algorithms, encapsulates each one, and lets clients switch between them at runtime without changing their code.
-
A.
Template Method
Template Method is a behavioral design pattern that defines the skeleton of an algorithm in a base class while allowing subclasses to override specific steps without changing the algorithm’s overall structure.
-
B.
Design Patterns: Elements of Reusable Object-Oriented Software
Design Patterns: Elements of Reusable Object-Oriented Software is a seminal software engineering book by the "Gang of Four" that catalogues foundational object-oriented design patterns widely used in software development.
-
C.
Chain of Responsibility
Chain of Responsibility is a behavioral design pattern that decouples senders and receivers by passing a request along a chain of potential handlers until one of them processes it.
-
D.
Dependency Inversion Principle
The Dependency Inversion Principle is an object-oriented design guideline that promotes decoupling by having high-level and low-level modules depend on shared abstractions rather than concrete implementations.
-
E.
The Design
"The Design" is a lesser-known work associated with American actress and writer Betsy Drake, reflecting her creative pursuits beyond her film career.
- F. None of above. chosen
Statements (50)
| Predicate | Object |
|---|---|
| instanceOf |
behavioral design pattern
ⓘ
software design pattern ⓘ |
| advantage |
improves code maintainability
ⓘ
improves testability of algorithms in isolation ⓘ promotes composition over inheritance ⓘ reduces conditional complexity ⓘ supports adding new algorithms without modifying existing client code ⓘ |
| alsoKnownAs | Policy pattern NERFINISHED ⓘ |
| applicableWhen |
a class has many conditional statements selecting different behaviors
ⓘ
clients should be able to choose algorithms at runtime ⓘ many related classes differ only in their behavior ⓘ there are different variants of an algorithm needed ⓘ |
| belongsToCategory | Gang of Four design patterns NERFINISHED ⓘ |
| contrastedWith | hard-coded conditional logic for algorithm selection ⓘ |
| definedIn | Design Patterns: Elements of Reusable Object-Oriented Software NERFINISHED ⓘ |
| definesRole |
ConcreteStrategy implements a specific algorithm
NERFINISHED
ⓘ
Context delegates algorithmic work to the Strategy object ⓘ Context maintains a reference to a Strategy object ⓘ Strategy defines a common interface for all supported algorithms ⓘ |
| describedByAuthor |
Erich Gamma
NERFINISHED
ⓘ
John Vlissides NERFINISHED ⓘ Ralph Johnson NERFINISHED ⓘ Richard Helm NERFINISHED ⓘ |
| disadvantage |
increases number of classes
ⓘ
may introduce overhead of indirection ⓘ requires clients to understand different strategies ⓘ |
| exampleUseCase |
compression with different compression algorithms
ⓘ
payment processing with different payment methods ⓘ routing with different pathfinding algorithms ⓘ sorting with different comparison strategies ⓘ |
| hasParticipant |
ConcreteStrategy
ⓘ
Context ⓘ Strategy interface NERFINISHED ⓘ |
| primaryIntent |
define a family of algorithms, encapsulate each one, and make them interchangeable
ⓘ
let algorithms vary independently from clients that use them ⓘ |
| relatedTo |
Decorator (design pattern)
NERFINISHED
ⓘ
Factory Method (design pattern) NERFINISHED ⓘ State (design pattern) NERFINISHED ⓘ Template Method (design pattern) NERFINISHED ⓘ |
| supportsFeature |
algorithm interchangeability
ⓘ
elimination of conditional logic based on algorithm choice ⓘ encapsulation of algorithms ⓘ open/closed principle ⓘ runtime selection of algorithms ⓘ single responsibility principle ⓘ |
| typicalImplementationLanguage |
C#
ⓘ
C++ NERFINISHED ⓘ Java NERFINISHED ⓘ JavaScript NERFINISHED ⓘ Python NERFINISHED ⓘ |
How these facts were elicited
The pipeline generated the facts above by prompting gpt-5.1 with this entity's name + description and the instruction below.
You are a knowledge base construction expert. Given a subject entity and a description of it, return factual statements that you know for the subject as a JSON list of dictionaries(triples), where keys must be "subject", "predicate" and "object". The number of facts may be very high, between 25 to 50 or more, for very popular subjects. For less popular subjects, the number of facts can be very low, like 5 or 10. # Requirements - If you don't know the subject at all, return an empty list. - If the subject is not a named entity, return an empty list. - Include at least one triple where predicate is "instanceOf". - Do not get too wordy. - Separate several objects into multiple triples with one object.
Subject: Strategy (design pattern) Description of subject: Strategy is a behavioral design pattern that defines a family of interchangeable algorithms, encapsulates each one, and lets clients switch between them at runtime without changing their code.
Referenced by (2)
Full triples — surface form annotated when it differs from this entity's canonical label.