Thanks to visit codestin.com
Credit goes to github.com

Skip to content

FirasConsultant/DesignPatterns_StrategyPattern

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

DesignPatterns - Strategy

C# Implementation of Examples from Head First Design Patterns This solution is an implementation of the Strategy Pattern using the Duck Simulator example from the book Head First Design Patterns.

The Strategy Pattern defines a family of algorithms, encapsulates each one, and makes them interchangeable. Strategy lets the algorithm vary independently from the clients that use it.

Here the Duck and its extended classes like, MallardDuck, RubberDUck , etc are the Client The Fly and Quack properties of each duck are encapsulated in the IFlyBehavior and IQuackBehavior interfaces. These interfaces can be implemented based on the class that will implement it i.e FlyWithWings implements IFlyBehavior and has the ability to fly, whereas the FlyNoWay implements IFlyBehavior but cannot fly.

About

C# Implementation of Examples from Head First Design Patterns

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%