Design Pattern in Software Engineering

17
Design Pattern Manish Kumar Roll-13118037 Semester-6 th National Institute of Technology Raipur ,India

Transcript of Design Pattern in Software Engineering

Page 1: Design Pattern in Software Engineering

Design PatternManish KumarRoll-13118037Semester-6th

National Institute of Technology Raipur ,India

Page 2: Design Pattern in Software Engineering

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

Page 3: Design Pattern in Software Engineering

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.

Page 4: Design Pattern in Software Engineering

Classification of Design Pattern

Page 5: Design Pattern in Software Engineering

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.

Page 6: Design Pattern in Software Engineering

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.

Page 7: Design Pattern in Software Engineering

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.

Page 8: Design Pattern in Software Engineering

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.

Page 9: Design Pattern in Software Engineering

Architecture

Page 10: Design Pattern in Software Engineering

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%

Page 11: Design Pattern in Software Engineering
Page 12: Design Pattern in Software Engineering
Page 13: Design Pattern in Software Engineering
Page 14: Design Pattern in Software Engineering
Page 15: Design Pattern in Software Engineering

Benefits of Strategy Design Pattern

1.Eliminates large conditional statements.

2.Provides a choice of implementations for the

same behavior.

Page 17: Design Pattern in Software Engineering