{"id":20196194,"url":"https://github.com/shaikrasheed99/strategy-pattern","last_synced_at":"2026-05-08T20:31:35.687Z","repository":{"id":113142687,"uuid":"480327760","full_name":"shaikrasheed99/strategy-pattern","owner":"shaikrasheed99","description":"Implementation of Strategy Pattern.","archived":false,"fork":false,"pushed_at":"2022-04-15T15:43:05.000Z","size":224,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-10T08:58:48.400Z","etag":null,"topics":["design-patterns","java","strategy-pattern","tdd","tdd-java"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shaikrasheed99.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-04-11T10:16:40.000Z","updated_at":"2023-01-03T03:29:11.000Z","dependencies_parsed_at":null,"dependency_job_id":"5c40e8c8-b0f8-4e1e-9b09-45683e852a7a","html_url":"https://github.com/shaikrasheed99/strategy-pattern","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/shaikrasheed99/strategy-pattern","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shaikrasheed99%2Fstrategy-pattern","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shaikrasheed99%2Fstrategy-pattern/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shaikrasheed99%2Fstrategy-pattern/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shaikrasheed99%2Fstrategy-pattern/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shaikrasheed99","download_url":"https://codeload.github.com/shaikrasheed99/strategy-pattern/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shaikrasheed99%2Fstrategy-pattern/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32795856,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T08:22:46.396Z","status":"ssl_error","status_checked_at":"2026-05-08T08:22:45.650Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["design-patterns","java","strategy-pattern","tdd","tdd-java"],"created_at":"2024-11-14T04:22:23.698Z","updated_at":"2026-05-08T20:31:35.652Z","avatar_url":"https://github.com/shaikrasheed99.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Strategy pattern examples using Test Driven Development\n\n## Example-1 (ShoppingMall):\n\n* There is a shopping mall which will calculate the bill amount based on the discount coupon.\n* Discount coupons will be used only on specific days, we will have percentages according to the days.\n* Based on the week day, the shopping mall should give discounts at any point of time.\n* Now strategy pattern is used, whenever a shopping mall needs a particular discount during run time.\n\n\u003cbr/\u003e\n\n### code: [shopping mall](https://github.com/shaikrasheed99/strategy-pattern/tree/master/src/main/java/com/tw)\n\n\u003cbr/\u003e\n\n![](class-diagrams/shopping-mall-strategy-pattern.png)\n\n\u003cbr/\u003e\n\n## Example-2 (Student):\n\n* There is a student who is studying a particular grade. \n* If his grade is less than two, then he must write his homework with his slate pencil. \n* If his grade is less than five and greater than two, then he must use a pencil for his homework. \n* If his grade is greater than five, then he is allowed to use a pen for his writings\n\n\u003cbr/\u003e\n\n### code: [student](https://github.com/shaikrasheed99/strategy-pattern/tree/master/src/main/java/com/tw)\n\n\u003cbr/\u003e\n\n![](class-diagrams/student-strategy-pattern.png)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshaikrasheed99%2Fstrategy-pattern","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshaikrasheed99%2Fstrategy-pattern","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshaikrasheed99%2Fstrategy-pattern/lists"}