Design Pattern in Software Engineering
-
Upload
manish-kumar -
Category
Engineering
-
view
234 -
download
2
Transcript of Design Pattern in Software Engineering
Design PatternManish KumarRoll-13118037Semester-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_Software_Engineering/Architecture/Design_Patterns
• https://en.wikipedia.org/wiki/Software_design_pattern
• https://sourcemaking.com/design_patterns/strategy
• http://www.slideshare.net/ganeshkolhe/strategy-design-pattern-12032203?related=5
• http://www.tutorialspoint.com/design_pattern/strategy_pattern.htm
• http://www.oodesign.com/strategy-pattern.html