From a7ef9ad98410224155d082165c86a428927613c6 Mon Sep 17 00:00:00 2001 From: Arushi Tariyal <112552758+ArushiTariyal@users.noreply.github.com> Date: Tue, 27 May 2025 17:49:16 +0530 Subject: [PATCH] Update README.md --- strategy/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/strategy/README.md b/strategy/README.md index 9f9148ccd842..844d94d58a69 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. +Encapsulate a family of related algorithms in Java and make them interchangeable without modifying the clients that use them. ## 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