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 (3)
| Label | Occurrences |
|---|---|
| ConcreteStrategy implements a specific algorithm | 1 |
| 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 ⓘ |
| 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
ⓘ
linked to:
Gang of Four design pattern
|
| contrastedWith | hard-coded conditional logic for algorithm selection ⓘ |
| definedIn | Design Patterns: Elements of Reusable Object-Oriented Software ⓘ |
| definesRole |
ConcreteStrategy implements a specific algorithm
ⓘ
linked to:
Strategy (design pattern)
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
ⓘ
John Vlissides ⓘ Ralph Johnson ⓘ Richard Helm ⓘ |
| 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 ⓘ
linked to:
Strategy pattern
|
| 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)
ⓘ
linked to:
Decorator
Factory Method (design pattern) ⓘ
linked to:
Factory Method
State (design pattern) ⓘ
linked to:
State design pattern
Template Method (design pattern) ⓘ
linked to:
Template Method
|
| 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++ ⓘ Java ⓘ JavaScript ⓘ Python ⓘ |
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 (3)
Full triples — surface form annotated when it differs from this entity's canonical label.