Design Pattern
Manish Kumar
Roll-13118037
Semester-6th
National Institute of Technology
Raipur ,India
OUTLINE
• What is Design Pattern?
• Classification of Design Pattern
• Creational patterns
• Structural patterns
• Behavioral patterns
• Strategy Design Pattern
• Architecture
• Applications And Examples
• Benefits of Strategy Design Pattern
What is Design Pattern?
In software engineering, a design pattern is a general reusable
solution to a commonly occurring problem in software design.
A design pattern is not a finished design that can be transformed
directly into code.
It is a description or template for how to solve a problem that can
be used in many different situations.
Classification of Design Pattern
Creational patterns
• In software engineering, creational design
patterns are design patterns that deal with object
creation mechanisms,
• trying to create objects in a manner suitable to
the situation.
• The basic form of object creation could result in
design problems or added complexity to the
design. Creational design patterns solve this
problem by somehow controlling this object
creation.
Structural patterns
• In Software Engineering, Structural Design
Patterns are Design Patterns that ease the
design by identifying a simple way to realize
relationships between entities.
Behavioral patterns
• In software engineering, behavioral design
patterns are design patterns that identify
common communication patterns between
objects and realize these patterns. By doing
so, these patterns increase flexibility in
carrying out this communication.
Strategy Design Pattern
• Define a family of algorithms, encapsulate
each one, and make them interchangeable.
Strategy lets the algorithm vary independently
from the clients that use it.
Architecture
Applications And Examples
• Shopping mall Example
1. Accept Customer Details
2. calculate the bill
3.Apply Discount Based on day of the week
(a) Monday Low discount -10%
(b) Thursday High discount-50%
Benefits of Strategy Design
Pattern
1.Eliminates large conditional
statements.
2.Provides a choice of
implementations for the
same behavior.
References
• https://en.wikibooks.org/wiki/Introduction_to_Softwar
e_Engineering/Architecture/Design_Patterns
• https://en.wikipedia.org/wiki/Software_design_patter
n
• https://sourcemaking.com/design_patterns/strategy
• http://www.slideshare.net/ganeshkolhe/strategy-
design-pattern-12032203?related=5
• http://www.tutorialspoint.com/design_pattern/strateg
y_pattern.htm
• http://www.oodesign.com/strategy-pattern.html
Design Pattern in Software Engineering

Design Pattern in Software Engineering

  • 1.
  • 2.
    OUTLINE • What isDesign Pattern? • Classification of Design Pattern • Creational patterns • Structural patterns • Behavioral patterns • Strategy Design Pattern • Architecture • Applications And Examples • Benefits of Strategy Design Pattern
  • 3.
    What is DesignPattern? In software engineering, a design pattern is a general reusable solution to a commonly occurring problem in software design. A design pattern is not a finished design that can be transformed directly into code. It is a description or template for how to solve a problem that can be used in many different situations.
  • 4.
  • 5.
    Creational patterns • Insoftware engineering, creational design patterns are design patterns that deal with object creation mechanisms, • trying to create objects in a manner suitable to the situation. • The basic form of object creation could result in design problems or added complexity to the design. Creational design patterns solve this problem by somehow controlling this object creation.
  • 6.
    Structural patterns • InSoftware Engineering, Structural Design Patterns are Design Patterns that ease the design by identifying a simple way to realize relationships between entities.
  • 7.
    Behavioral patterns • Insoftware engineering, behavioral design patterns are design patterns that identify common communication patterns between objects and realize these patterns. By doing so, these patterns increase flexibility in carrying out this communication.
  • 8.
    Strategy Design Pattern •Define a family of algorithms, encapsulate each one, and make them interchangeable. Strategy lets the algorithm vary independently from the clients that use it.
  • 9.
  • 10.
    Applications And Examples •Shopping mall Example 1. Accept Customer Details 2. calculate the bill 3.Apply Discount Based on day of the week (a) Monday Low discount -10% (b) Thursday High discount-50%
  • 15.
    Benefits of StrategyDesign Pattern 1.Eliminates large conditional statements. 2.Provides a choice of implementations for the same behavior.
  • 16.
    References • https://en.wikibooks.org/wiki/Introduction_to_Softwar e_Engineering/Architecture/Design_Patterns • https://en.wikipedia.org/wiki/Software_design_patter n •https://sourcemaking.com/design_patterns/strategy • http://www.slideshare.net/ganeshkolhe/strategy- design-pattern-12032203?related=5 • http://www.tutorialspoint.com/design_pattern/strateg y_pattern.htm • http://www.oodesign.com/strategy-pattern.html