From 753f0e214b806cd25031e9b4c13124b190860507 Mon Sep 17 00:00:00 2001 From: Kartik Agarwal Date: Wed, 8 Oct 2025 09:59:27 +0530 Subject: [PATCH] docs: Refine language in Strategy Pattern README --- strategy/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/strategy/README.md b/strategy/README.md index 9f9148ccd842..c6c5e3e0a45b 100644 --- a/strategy/README.md +++ b/strategy/README.md @@ -18,13 +18,13 @@ tag: ## Intent of Strategy Design Pattern -Define a family of algorithms in Java, encapsulate each one, and make them interchangeable to enhance software development using the Strategy design pattern. Strategy lets the algorithm vary independently of the clients that use it. +The Strategy pattern defines a family of interchangeable algorithms, allowing the specific algorithm to be selected and swapped at runtime. ## Detailed Explanation of Strategy Pattern with Real-World Examples Real-world example -> A practical real-world example of the Strategy design pattern in Java is evident in car navigation systems, where algorithm flexibility is paramount. Different navigation algorithms (such as shortest route, fastest route, and scenic route) can be used to determine the best path from one location to another. Each algorithm encapsulates a specific strategy for calculating the route. The user (client) can switch between these algorithms based on their preferences without changing the navigation system itself. This allows for flexible and interchangeable navigation strategies within the same system. +> A practical real-world example of the Strategy design pattern in Java can be seen in car navigation systems, where algorithm flexibility is paramount. Different navigation algorithms (such as shortest route, fastest route, and scenic route) can be used to determine the best path from one location to another. Each algorithm encapsulates a specific strategy for calculating the route. The user (client) can switch between these algorithms based on their preferences without changing the navigation system itself. This allows for flexible and interchangeable navigation strategies within the same system. In plain words