Agenda
01
What is Design Pattern?
01
Types of Design Pattern
02
Creational Design Pattern
03
Structural Design Patterns
04
Behavioral Design Patterns
05
Conclusion
06
Click here to watch the video
What is Design Pattern?
What is Design Pattern?
Design Patterns are a reusable solution to typical software
design issues that arise frequently in real-world application
development.
Patterns are employed by developers to tackle challenges in
their individual designs.
Understanding design patterns is more important than
memorizing their classes, methods, and attributes.
Individual needs and difficulties influence pattern selection and
usage among numerous design patterns.
Types of Design Pattern
Types of Design Pattern
Creational Design Pattern
Creational Design Pattern
Abstract Factory Builder Factory Method
Prototype Singleton
Creational Design Pattern
Abstract Factory
01
The Abstract Factory design pattern allows you to create families of
linked items without having to declare their classes.
Creational Design Pattern
Builder is a design pattern that allows you to build complicated objects in
stages.
The pattern enables you to create many types and representations of an
object while using the same creation code.
Builder
02
Creational Design Pattern
A Factory Method is a creational design pattern that provides an
interface for creating objects in a superclass
while allowing subclasses to choose the type of objects created.
Factory Method
03
Creational Design Pattern
Prototype is a design pattern that allows you to imitate existing objects
without making your code reliant on their classes.
The Prototype pattern provides a basic interface for working with all
objects that permit cloning to the client code.
Prototype
04
Creational Design Pattern
The singleton design pattern ensures that a class has only one
instance
While also giving a global access point to that instance.
Singleton
05
Structural Design Patterns
Structural Design Patterns
Adapter Bridge Composite Decorator
Facade Flyweight Proxy
Structural Design Patterns
The adapter design pattern is a structural design pattern that allows
items with conflicting interfaces to work with one another.
Use this technique to reuse many existing subclasses that lack common
functionality that cannot be added to the superclass.
Adapter
01
Structural Design Patterns
Bridge is a structural design pattern that allows you to split a large class or
a collection of related classes into two independent hierarchies.
• Abstraction
• Implementation
Bridge
02
Structural Design Patterns
Composite is a structural design pattern that enables you to
organize parts into tree structures and manipulate them
independently of one another.
The Composite pattern provides two basic element kinds with a
shared interface
• Simple leaves
• complex containers
Composite
03
Structural Design Patterns
Decorator is a structural design pattern that allows you to add
additional behaviors to objects by wrapping them in special wrapper
objects.
Use the Decorator technique to add extra behaviors to objects without
disrupting the code that utilizes them.
Decorator
04
Structural Design Patterns
Facade is a structural design pattern that simplifies complex library,
framework, or class interfaces.
When you require a simple but limited interface to a complicated
subsystem, use the Facade pattern.
Facade
05
Structural Design Patterns
Flyweight is a structural design approach that allows you to fit more
items into RAM by exchanging state between objects instead of
holding it all in one.
Flyweight teaches how to construct lots of little objects, while Facade
shows how to make one big one.
Flyweight
06
Structural Design Patterns
Proxy is a structural design technique that enables you substitute an
item.
A proxy controls access to the source object, allowing you to do
actions before or after the request.
Proxy
07
Behavioural Design Patterns
Behavioural Design Patterns
Chain of
Responsibility
Iterator Memento State
Template Method Command Mediator
Behavioural Design Patterns
Observer Strategy
Visitor
Behavioural Design Patterns
A behavioral design pattern called Chain of Responsibility allows you to
pass requests along a chain of handlers.
When a request is received, each handler determines whether to
process it or send it on to the next handler in the chain.
Chain of
Responsibility
01
Behavioural Design Patterns
Iterator is a behavioral design pattern that allows you to traverse
components of a collection without revealing the representation below
(list, stack, tree, etc.)
Iterators can be used to traverse Composite trees.
Iterator
02
Behavioural Design Patterns
Memento is a behavioral design pattern that saves and restores an
object's prior state without revealing its implementation.
When you need to take pictures of an object's state in order to restore it
to a previous state, use the Memento pattern.
Memento
03
Behavioural Design Patterns
State is a behavioral design pattern that allows an entity to change its
behavior in response to changes in its internal state.
It appears that the object's class has changed.
State
04
Behavioural Design Patterns
Template Method is a behavioral design that lets subclasses alter steps
of an algorithm without changing its structure.
We use the Template Method to allow customers extend specific steps
of an algorithm, not the entire method or its structure.
Template
05
Behavioural Design Patterns
Command is a behavioral design pattern that turns a request into a
standalone object.
This transformation supports unachievable operations and passing
requests as method arguments.
Command
06
Behavioural Design Patterns
Mediator is a behavioral design pattern that reduces object
dependencies.
To collaborate, the objects must first communicate through a mediator
object.
Mediator
07
Behavioural Design Patterns
Observer is a behavioral design pattern that allows you to establish a
subscription mechanism to alert numerous objects about any events that
occur to the item being observed.
When some objects in your app must monitor others for a limited time or in
specific circumstances, use the pattern.
Observer
08
Behavioural Design Patterns
Strategy is a behavioral design pattern that allows you to construct a
family of algorithms, classify them, and make their objects
interchangeable.
When you have a bunch of similar classes that just differ in how they
perform some behavior, use the Strategy.
Strategy
09
Behavioural Design Patterns
The Visitor pattern is a behavioral design pattern that allows you to
decouple algorithms from the objects they act on.
When you need to perform an operation on all elements of a
complicated object structure, use the Visitor.
Visitor
10
Conclusion
Abstract Factory classes are frequently based on a set of Factory Methods, although the methods
on these classes can also be composed using Prototype.
Conclusion
To reduce RAM, you can use Flyweights to construct shared Composite tree leaf nodes.
Conclusion
You can treat Visitor as a powerful version of the Command pattern. Its objects can execute
operations over various objects of different classes.
Conclusion
C# Design Patterns | Design Pattern Tutorial For Beginners | C# Programming Tutorial | Simplilearn

C# Design Patterns | Design Pattern Tutorial For Beginners | C# Programming Tutorial | Simplilearn

  • 2.
  • 3.
    01 What is DesignPattern? 01 Types of Design Pattern 02 Creational Design Pattern 03 Structural Design Patterns 04 Behavioral Design Patterns 05 Conclusion 06
  • 4.
    Click here towatch the video
  • 5.
  • 6.
    What is DesignPattern? Design Patterns are a reusable solution to typical software design issues that arise frequently in real-world application development. Patterns are employed by developers to tackle challenges in their individual designs. Understanding design patterns is more important than memorizing their classes, methods, and attributes. Individual needs and difficulties influence pattern selection and usage among numerous design patterns.
  • 7.
  • 8.
  • 9.
  • 10.
    Creational Design Pattern AbstractFactory Builder Factory Method Prototype Singleton
  • 11.
    Creational Design Pattern AbstractFactory 01 The Abstract Factory design pattern allows you to create families of linked items without having to declare their classes.
  • 12.
    Creational Design Pattern Builderis a design pattern that allows you to build complicated objects in stages. The pattern enables you to create many types and representations of an object while using the same creation code. Builder 02
  • 13.
    Creational Design Pattern AFactory Method is a creational design pattern that provides an interface for creating objects in a superclass while allowing subclasses to choose the type of objects created. Factory Method 03
  • 14.
    Creational Design Pattern Prototypeis a design pattern that allows you to imitate existing objects without making your code reliant on their classes. The Prototype pattern provides a basic interface for working with all objects that permit cloning to the client code. Prototype 04
  • 15.
    Creational Design Pattern Thesingleton design pattern ensures that a class has only one instance While also giving a global access point to that instance. Singleton 05
  • 16.
  • 17.
    Structural Design Patterns AdapterBridge Composite Decorator Facade Flyweight Proxy
  • 18.
    Structural Design Patterns Theadapter design pattern is a structural design pattern that allows items with conflicting interfaces to work with one another. Use this technique to reuse many existing subclasses that lack common functionality that cannot be added to the superclass. Adapter 01
  • 19.
    Structural Design Patterns Bridgeis a structural design pattern that allows you to split a large class or a collection of related classes into two independent hierarchies. • Abstraction • Implementation Bridge 02
  • 20.
    Structural Design Patterns Compositeis a structural design pattern that enables you to organize parts into tree structures and manipulate them independently of one another. The Composite pattern provides two basic element kinds with a shared interface • Simple leaves • complex containers Composite 03
  • 21.
    Structural Design Patterns Decoratoris a structural design pattern that allows you to add additional behaviors to objects by wrapping them in special wrapper objects. Use the Decorator technique to add extra behaviors to objects without disrupting the code that utilizes them. Decorator 04
  • 22.
    Structural Design Patterns Facadeis a structural design pattern that simplifies complex library, framework, or class interfaces. When you require a simple but limited interface to a complicated subsystem, use the Facade pattern. Facade 05
  • 23.
    Structural Design Patterns Flyweightis a structural design approach that allows you to fit more items into RAM by exchanging state between objects instead of holding it all in one. Flyweight teaches how to construct lots of little objects, while Facade shows how to make one big one. Flyweight 06
  • 24.
    Structural Design Patterns Proxyis a structural design technique that enables you substitute an item. A proxy controls access to the source object, allowing you to do actions before or after the request. Proxy 07
  • 25.
  • 26.
    Behavioural Design Patterns Chainof Responsibility Iterator Memento State Template Method Command Mediator
  • 27.
  • 28.
    Behavioural Design Patterns Abehavioral design pattern called Chain of Responsibility allows you to pass requests along a chain of handlers. When a request is received, each handler determines whether to process it or send it on to the next handler in the chain. Chain of Responsibility 01
  • 29.
    Behavioural Design Patterns Iteratoris a behavioral design pattern that allows you to traverse components of a collection without revealing the representation below (list, stack, tree, etc.) Iterators can be used to traverse Composite trees. Iterator 02
  • 30.
    Behavioural Design Patterns Mementois a behavioral design pattern that saves and restores an object's prior state without revealing its implementation. When you need to take pictures of an object's state in order to restore it to a previous state, use the Memento pattern. Memento 03
  • 31.
    Behavioural Design Patterns Stateis a behavioral design pattern that allows an entity to change its behavior in response to changes in its internal state. It appears that the object's class has changed. State 04
  • 32.
    Behavioural Design Patterns TemplateMethod is a behavioral design that lets subclasses alter steps of an algorithm without changing its structure. We use the Template Method to allow customers extend specific steps of an algorithm, not the entire method or its structure. Template 05
  • 33.
    Behavioural Design Patterns Commandis a behavioral design pattern that turns a request into a standalone object. This transformation supports unachievable operations and passing requests as method arguments. Command 06
  • 34.
    Behavioural Design Patterns Mediatoris a behavioral design pattern that reduces object dependencies. To collaborate, the objects must first communicate through a mediator object. Mediator 07
  • 35.
    Behavioural Design Patterns Observeris a behavioral design pattern that allows you to establish a subscription mechanism to alert numerous objects about any events that occur to the item being observed. When some objects in your app must monitor others for a limited time or in specific circumstances, use the pattern. Observer 08
  • 36.
    Behavioural Design Patterns Strategyis a behavioral design pattern that allows you to construct a family of algorithms, classify them, and make their objects interchangeable. When you have a bunch of similar classes that just differ in how they perform some behavior, use the Strategy. Strategy 09
  • 37.
    Behavioural Design Patterns TheVisitor pattern is a behavioral design pattern that allows you to decouple algorithms from the objects they act on. When you need to perform an operation on all elements of a complicated object structure, use the Visitor. Visitor 10
  • 38.
  • 39.
    Abstract Factory classesare frequently based on a set of Factory Methods, although the methods on these classes can also be composed using Prototype. Conclusion
  • 40.
    To reduce RAM,you can use Flyweights to construct shared Composite tree leaf nodes. Conclusion
  • 41.
    You can treatVisitor as a powerful version of the Command pattern. Its objects can execute operations over various objects of different classes. Conclusion