SlideShare a Scribd company logo
1 of 27
Download to read offline
Design Patterns for software
engineering
Presented by:
Rohan Jain
Tanisha Bhayani
Akshay Bhanderi
Abhay Desale
What is design pattern?
● Design patterns are typical solutions to commonly occurring problems in software design.
● They are like pre-made blueprints that you can customize to solve a recurring design problem in your
code.
● Types of design pattern
○ Creational Design Patterns
○ Structural Design Patterns
○ Behavioral Design Patterns
Creational Design Pattern: Factory Method
we create object without exposing the creation logic to client and the client use the same common interface to
create new type of object
Creational Design Pattern:Abstract Factory
Lets you produce families of related objects without specifying their concrete classes.
Creational Design Pattern: Builder
● That lets you construct complex objects step by step.
● The pattern allows you to produce different types and representations of an object using the same
construction code.
Creational Design Pattern: Singleton
class Database is
private static field instance: Database
private constructor Database() is
public static method getInstance() is
if (Database.instance == null) then
acquireThreadLock() and then
if (Database.instance == null) then
Database.instance = new Database()
return Database.instance
public method query(sql) is
class Application is
method main() is
Database foo =
Database.getInstance()
foo.query("SELECT ...")
// ...
Database bar =
Database.getInstance()
bar.query("SELECT ...")
// The variable `bar`
will contain the same object as
// the variable `foo`.
That lets you ensure that a class has only one instance, while providing a global access point to this instance.
Creational Design Pattern: Prototype
lets you copy existing objects without making your code dependent on their classes.
Structure Design Pattern: Adapter Pattern
Scenario:
Two incompatible interfaces but the core functionality is same.
Class Adapter - Inheritance Object Adapter - Delegation through Composition
Structure Design Pattern: Bridge Pattern
Scenario:
Vary the implementation and the abstraction by placing the two into separate class hierarchies.
Structure Design Pattern: Composite Pattern
Scenario:
When clients ignore the difference between compositions of objects and individual objects.
Structure Design Pattern: Decorator Pattern
Scenario:
Allows behavior to be added to an individual object, dynamically, without affecting the behavior of other
objects from the same class.
Structure Design Pattern: Facade Pattern
Scenario:
The client facing interface needs simplification.
Structure Design Pattern: Flyweight Pattern
Scenario:
Minimize memory usage or computational expenses by sharing as much as possible with similar objects.
Structure Design Pattern: Proxy Pattern
Scenario:
When client needs to protect, hide complexity, or delay expensive actions.
Anti Pattern
● Applying a particular design pattern in the improper context.
Behaviour Pattern
● Behavioral design patterns are concerned with the interaction and responsibility of objects.
Behaviour Design Pattern: Chain of Responsibility
What it suggests?
Pass the request along the chain
of handlers instead of one.
Control order of request handling
Behaviour Design Pattern: Command
What is suggets?
Turns a request into a stand-alone object
that contains all information about the request.
Behaviour Design Pattern: Iterator
What is suggets?
lets you traverse elements of a collection
without exposing its underlying representation
Behaviour Design Pattern: Meditor
What is suggets?
This pattern restricts direct
communications between the objects and forces
them to collaborate only via a mediator object.
Increases reusability
Behaviour Design Pattern: Template Method
What it says?
Just define the skeleton of a function in
an operation, deferring some steps to its
subclasses.
Remove duplication
Behaviour Design Pattern: Visitor
What is says?
Visitor lets you define a new operation
without changing the classes of the elements on
which it operates.
Behaviour Design Pattern: Memento
Lets you save and restore the previous state of an object without revealing the details of its
implementation.
Behaviour Design Pattern: Observer
Lets you define a subscription mechanism to notify multiple objects about any events that happen to the
object they’re observing.
Behaviour Design Pattern: State
Lets an object alter its behavior when its internal state changes. It appears as if the object changed its
class.
Behaviour Design Pattern: Strategy
Lets you define a family of algorithms, put each of them into a separate class, and make their objects
interchangeable.
Problem Solution
References
● https://refactoring.guru/design-patterns
● https://www.javatpoint.com/design-patterns-in-java
● https://sourcemaking.com/design_patterns
● https://www.youtube.com/watch?v=TeZqKnC2gvA (for visiter)
● https://www.youtube.com/watch?v=7Pj5kAhVBlg
● https://medium.com/educative/the-7-most-important-software-design-patterns-d60e546afb0e
● https://medium.com/federicohaag/coding-better-using-design-patterns-4d7385a9e7ac
● https://www.youtube.com/watch?v=v9ejT8FO-7I&list=PLrhzvIcii6GNjpARdnO4ueTUAVR9eMBpc(Design
Pattern Series)
● https://en.wikipedia.org/wiki/Structural_pattern
● https://stackoverflow.com/questions/980601/what-is-an-anti-pattern
● https://dev.to/carlillo/design-patterns---adapter-2pi3
● https://stackoverflow.com/questions/319728/when-do-you-use-the-bridge-pattern-how-is-it-different-from-
adapter-pattern
● https://en.wikipedia.org/wiki/Composite_pattern
● https://en.wikipedia.org/wiki/Decorator_pattern
● https://en.wikipedia.org/wiki/Facade_pattern
● https://www.oreilly.com/library/view/learning-javascript-design/9781449334840/ch09s18.html
● http://www.cs.sjsu.edu/faculty/pearce/modules/patterns/distArch/proxy.htm
Thank You
Any Question?

More Related Content

What's hot

PATTERNS04 - Structural Design Patterns
PATTERNS04 - Structural Design PatternsPATTERNS04 - Structural Design Patterns
PATTERNS04 - Structural Design PatternsMichael Heron
 
PATTERNS03 - Behavioural Design Patterns
PATTERNS03 - Behavioural Design PatternsPATTERNS03 - Behavioural Design Patterns
PATTERNS03 - Behavioural Design PatternsMichael Heron
 
Design patterns - Proxy & Composite
Design patterns - Proxy & CompositeDesign patterns - Proxy & Composite
Design patterns - Proxy & CompositeSarath C
 
Java design patterns
Java design patternsJava design patterns
Java design patternsShawn Brito
 
Introduction to Design Pattern
Introduction to Design  PatternIntroduction to Design  Pattern
Introduction to Design PatternSanae BEKKAR
 
The visitor design pattern
The visitor design patternThe visitor design pattern
The visitor design patternSamnang Chhun
 
Software Design Patterns. Part I :: Structural Patterns
Software Design Patterns. Part I :: Structural PatternsSoftware Design Patterns. Part I :: Structural Patterns
Software Design Patterns. Part I :: Structural PatternsSergey Aganezov
 
PATTERNS02 - Creational Design Patterns
PATTERNS02 - Creational Design PatternsPATTERNS02 - Creational Design Patterns
PATTERNS02 - Creational Design PatternsMichael Heron
 
Design patterns
Design patternsDesign patterns
Design patternsavature
 
Design Pattern - Introduction
Design Pattern - IntroductionDesign Pattern - Introduction
Design Pattern - IntroductionMudasir Qazi
 
Basic design pattern interview questions
Basic design pattern interview questionsBasic design pattern interview questions
Basic design pattern interview questionsjinaldesailive
 

What's hot (20)

Composite design pattern
Composite design patternComposite design pattern
Composite design pattern
 
PATTERNS04 - Structural Design Patterns
PATTERNS04 - Structural Design PatternsPATTERNS04 - Structural Design Patterns
PATTERNS04 - Structural Design Patterns
 
PATTERNS03 - Behavioural Design Patterns
PATTERNS03 - Behavioural Design PatternsPATTERNS03 - Behavioural Design Patterns
PATTERNS03 - Behavioural Design Patterns
 
Design patterns - Proxy & Composite
Design patterns - Proxy & CompositeDesign patterns - Proxy & Composite
Design patterns - Proxy & Composite
 
Design patterns
Design patternsDesign patterns
Design patterns
 
Design patterns
Design patternsDesign patterns
Design patterns
 
Java design patterns
Java design patternsJava design patterns
Java design patterns
 
Design Patterns
Design PatternsDesign Patterns
Design Patterns
 
Mediator pattern
Mediator patternMediator pattern
Mediator pattern
 
Visitor pattern
Visitor patternVisitor pattern
Visitor pattern
 
Mediator
MediatorMediator
Mediator
 
Observer
ObserverObserver
Observer
 
Introduction to Design Pattern
Introduction to Design  PatternIntroduction to Design  Pattern
Introduction to Design Pattern
 
The visitor design pattern
The visitor design patternThe visitor design pattern
The visitor design pattern
 
Gof design patterns
Gof design patternsGof design patterns
Gof design patterns
 
Software Design Patterns. Part I :: Structural Patterns
Software Design Patterns. Part I :: Structural PatternsSoftware Design Patterns. Part I :: Structural Patterns
Software Design Patterns. Part I :: Structural Patterns
 
PATTERNS02 - Creational Design Patterns
PATTERNS02 - Creational Design PatternsPATTERNS02 - Creational Design Patterns
PATTERNS02 - Creational Design Patterns
 
Design patterns
Design patternsDesign patterns
Design patterns
 
Design Pattern - Introduction
Design Pattern - IntroductionDesign Pattern - Introduction
Design Pattern - Introduction
 
Basic design pattern interview questions
Basic design pattern interview questionsBasic design pattern interview questions
Basic design pattern interview questions
 

Similar to Design patterns

Gang of Four in Java
Gang of Four in Java Gang of Four in Java
Gang of Four in Java Mina Tafreshi
 
C# Design Patterns | Design Pattern Tutorial For Beginners | C# Programming T...
C# Design Patterns | Design Pattern Tutorial For Beginners | C# Programming T...C# Design Patterns | Design Pattern Tutorial For Beginners | C# Programming T...
C# Design Patterns | Design Pattern Tutorial For Beginners | C# Programming T...Simplilearn
 
dotnet stuff.com tutorials-design-patterns_exploring-net-design-patterns-in-s...
dotnet stuff.com tutorials-design-patterns_exploring-net-design-patterns-in-s...dotnet stuff.com tutorials-design-patterns_exploring-net-design-patterns-in-s...
dotnet stuff.com tutorials-design-patterns_exploring-net-design-patterns-in-s...Anil Sharma
 
5 Design Patterns Explained
5 Design Patterns Explained5 Design Patterns Explained
5 Design Patterns ExplainedPrabhjit Singh
 
Patterns (contd)Software Development ProcessDesign patte.docx
Patterns (contd)Software Development ProcessDesign patte.docxPatterns (contd)Software Development ProcessDesign patte.docx
Patterns (contd)Software Development ProcessDesign patte.docxdanhaley45372
 
Typescript design patterns applied to sharepoint framework - Sharepoint Satur...
Typescript design patterns applied to sharepoint framework - Sharepoint Satur...Typescript design patterns applied to sharepoint framework - Sharepoint Satur...
Typescript design patterns applied to sharepoint framework - Sharepoint Satur...Luis Valencia
 
Sofwear deasign and need of design pattern
Sofwear deasign and need of design patternSofwear deasign and need of design pattern
Sofwear deasign and need of design patternchetankane
 
Prophecy Of Design Patterns
Prophecy Of Design PatternsProphecy Of Design Patterns
Prophecy Of Design Patternspradeepkothiyal
 
Design Pattern Notes: Nagpur University
Design Pattern Notes: Nagpur UniversityDesign Pattern Notes: Nagpur University
Design Pattern Notes: Nagpur UniversityShubham Narkhede
 
Design pattern in android
Design pattern in androidDesign pattern in android
Design pattern in androidJay Kumarr
 
P Training Presentation
P Training PresentationP Training Presentation
P Training PresentationGaurav Tyagi
 
Java Design Patterns Tutorial | Edureka
Java Design Patterns Tutorial | EdurekaJava Design Patterns Tutorial | Edureka
Java Design Patterns Tutorial | EdurekaEdureka!
 
Creational Design Patterns.pptx
Creational Design Patterns.pptxCreational Design Patterns.pptx
Creational Design Patterns.pptxSachin Patidar
 
Itp oo mand-d
Itp oo mand-dItp oo mand-d
Itp oo mand-dShibu S R
 

Similar to Design patterns (20)

Gang of Four in Java
Gang of Four in Java Gang of Four in Java
Gang of Four in Java
 
C# Design Patterns | Design Pattern Tutorial For Beginners | C# Programming T...
C# Design Patterns | Design Pattern Tutorial For Beginners | C# Programming T...C# Design Patterns | Design Pattern Tutorial For Beginners | C# Programming T...
C# Design Patterns | Design Pattern Tutorial For Beginners | C# Programming T...
 
dotnet stuff.com tutorials-design-patterns_exploring-net-design-patterns-in-s...
dotnet stuff.com tutorials-design-patterns_exploring-net-design-patterns-in-s...dotnet stuff.com tutorials-design-patterns_exploring-net-design-patterns-in-s...
dotnet stuff.com tutorials-design-patterns_exploring-net-design-patterns-in-s...
 
Software Design Patterns
Software Design PatternsSoftware Design Patterns
Software Design Patterns
 
Software Design Patterns
Software Design PatternsSoftware Design Patterns
Software Design Patterns
 
5 Design Patterns Explained
5 Design Patterns Explained5 Design Patterns Explained
5 Design Patterns Explained
 
Design patterns
Design patternsDesign patterns
Design patterns
 
Patterns (contd)Software Development ProcessDesign patte.docx
Patterns (contd)Software Development ProcessDesign patte.docxPatterns (contd)Software Development ProcessDesign patte.docx
Patterns (contd)Software Development ProcessDesign patte.docx
 
Typescript design patterns applied to sharepoint framework - Sharepoint Satur...
Typescript design patterns applied to sharepoint framework - Sharepoint Satur...Typescript design patterns applied to sharepoint framework - Sharepoint Satur...
Typescript design patterns applied to sharepoint framework - Sharepoint Satur...
 
Design Patterns
Design PatternsDesign Patterns
Design Patterns
 
Sofwear deasign and need of design pattern
Sofwear deasign and need of design patternSofwear deasign and need of design pattern
Sofwear deasign and need of design pattern
 
Prophecy Of Design Patterns
Prophecy Of Design PatternsProphecy Of Design Patterns
Prophecy Of Design Patterns
 
Oops design pattern_amitgupta
Oops design pattern_amitguptaOops design pattern_amitgupta
Oops design pattern_amitgupta
 
Design Pattern Notes: Nagpur University
Design Pattern Notes: Nagpur UniversityDesign Pattern Notes: Nagpur University
Design Pattern Notes: Nagpur University
 
Design pattern in android
Design pattern in androidDesign pattern in android
Design pattern in android
 
P Training Presentation
P Training PresentationP Training Presentation
P Training Presentation
 
Introduction to Design Patterns
Introduction to Design PatternsIntroduction to Design Patterns
Introduction to Design Patterns
 
Java Design Patterns Tutorial | Edureka
Java Design Patterns Tutorial | EdurekaJava Design Patterns Tutorial | Edureka
Java Design Patterns Tutorial | Edureka
 
Creational Design Patterns.pptx
Creational Design Patterns.pptxCreational Design Patterns.pptx
Creational Design Patterns.pptx
 
Itp oo mand-d
Itp oo mand-dItp oo mand-d
Itp oo mand-d
 

Recently uploaded

Triangulation survey (Basic Mine Surveying)_MI10412MI.pptx
Triangulation survey (Basic Mine Surveying)_MI10412MI.pptxTriangulation survey (Basic Mine Surveying)_MI10412MI.pptx
Triangulation survey (Basic Mine Surveying)_MI10412MI.pptxRomil Mishra
 
Uk-NO1 Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Exp...
Uk-NO1 Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Exp...Uk-NO1 Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Exp...
Uk-NO1 Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Exp...Amil baba
 
AntColonyOptimizationManetNetworkAODV.pptx
AntColonyOptimizationManetNetworkAODV.pptxAntColonyOptimizationManetNetworkAODV.pptx
AntColonyOptimizationManetNetworkAODV.pptxLina Kadam
 
Structural Integrity Assessment Standards in Nigeria by Engr Nimot Muili
Structural Integrity Assessment Standards in Nigeria by Engr Nimot MuiliStructural Integrity Assessment Standards in Nigeria by Engr Nimot Muili
Structural Integrity Assessment Standards in Nigeria by Engr Nimot MuiliNimot Muili
 
Machine Learning 5G Federated Learning.pdf
Machine Learning 5G Federated Learning.pdfMachine Learning 5G Federated Learning.pdf
Machine Learning 5G Federated Learning.pdfadeyimikaipaye
 
2022 AWS DNA Hackathon 장애 대응 솔루션 jarvis.
2022 AWS DNA Hackathon 장애 대응 솔루션 jarvis.2022 AWS DNA Hackathon 장애 대응 솔루션 jarvis.
2022 AWS DNA Hackathon 장애 대응 솔루션 jarvis.elesangwon
 
Design and Analysis of Algorithms Lecture Notes
Design and Analysis of Algorithms Lecture NotesDesign and Analysis of Algorithms Lecture Notes
Design and Analysis of Algorithms Lecture NotesSreedhar Chowdam
 
priority interrupt computer organization
priority interrupt computer organizationpriority interrupt computer organization
priority interrupt computer organizationchnrketan
 
The Satellite applications in telecommunication
The Satellite applications in telecommunicationThe Satellite applications in telecommunication
The Satellite applications in telecommunicationnovrain7111
 
10 AsymmetricKey Cryptography students.pptx
10 AsymmetricKey Cryptography students.pptx10 AsymmetricKey Cryptography students.pptx
10 AsymmetricKey Cryptography students.pptxAdityaGoogle
 
Cost estimation approach: FP to COCOMO scenario based question
Cost estimation approach: FP to COCOMO scenario based questionCost estimation approach: FP to COCOMO scenario based question
Cost estimation approach: FP to COCOMO scenario based questionSneha Padhiar
 
A brief look at visionOS - How to develop app on Apple's Vision Pro
A brief look at visionOS - How to develop app on Apple's Vision ProA brief look at visionOS - How to develop app on Apple's Vision Pro
A brief look at visionOS - How to develop app on Apple's Vision ProRay Yuan Liu
 
Curve setting (Basic Mine Surveying)_MI10412MI.pptx
Curve setting (Basic Mine Surveying)_MI10412MI.pptxCurve setting (Basic Mine Surveying)_MI10412MI.pptx
Curve setting (Basic Mine Surveying)_MI10412MI.pptxRomil Mishra
 
TEST CASE GENERATION GENERATION BLOCK BOX APPROACH
TEST CASE GENERATION GENERATION BLOCK BOX APPROACHTEST CASE GENERATION GENERATION BLOCK BOX APPROACH
TEST CASE GENERATION GENERATION BLOCK BOX APPROACHSneha Padhiar
 
FUNCTIONAL AND NON FUNCTIONAL REQUIREMENT
FUNCTIONAL AND NON FUNCTIONAL REQUIREMENTFUNCTIONAL AND NON FUNCTIONAL REQUIREMENT
FUNCTIONAL AND NON FUNCTIONAL REQUIREMENTSneha Padhiar
 
Secure Key Crypto - Tech Paper JET Tech Labs
Secure Key Crypto - Tech Paper JET Tech LabsSecure Key Crypto - Tech Paper JET Tech Labs
Secure Key Crypto - Tech Paper JET Tech Labsamber724300
 
Detection&Tracking - Thermal imaging object detection and tracking
Detection&Tracking - Thermal imaging object detection and trackingDetection&Tracking - Thermal imaging object detection and tracking
Detection&Tracking - Thermal imaging object detection and trackinghadarpinhas1
 
Theory of Machine Notes / Lecture Material .pdf
Theory of Machine Notes / Lecture Material .pdfTheory of Machine Notes / Lecture Material .pdf
Theory of Machine Notes / Lecture Material .pdfShreyas Pandit
 
22CYT12 & Chemistry for Computer Systems_Unit-II-Corrosion & its Control Meth...
22CYT12 & Chemistry for Computer Systems_Unit-II-Corrosion & its Control Meth...22CYT12 & Chemistry for Computer Systems_Unit-II-Corrosion & its Control Meth...
22CYT12 & Chemistry for Computer Systems_Unit-II-Corrosion & its Control Meth...KrishnaveniKrishnara1
 

Recently uploaded (20)

Triangulation survey (Basic Mine Surveying)_MI10412MI.pptx
Triangulation survey (Basic Mine Surveying)_MI10412MI.pptxTriangulation survey (Basic Mine Surveying)_MI10412MI.pptx
Triangulation survey (Basic Mine Surveying)_MI10412MI.pptx
 
Uk-NO1 Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Exp...
Uk-NO1 Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Exp...Uk-NO1 Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Exp...
Uk-NO1 Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Exp...
 
AntColonyOptimizationManetNetworkAODV.pptx
AntColonyOptimizationManetNetworkAODV.pptxAntColonyOptimizationManetNetworkAODV.pptx
AntColonyOptimizationManetNetworkAODV.pptx
 
Structural Integrity Assessment Standards in Nigeria by Engr Nimot Muili
Structural Integrity Assessment Standards in Nigeria by Engr Nimot MuiliStructural Integrity Assessment Standards in Nigeria by Engr Nimot Muili
Structural Integrity Assessment Standards in Nigeria by Engr Nimot Muili
 
Machine Learning 5G Federated Learning.pdf
Machine Learning 5G Federated Learning.pdfMachine Learning 5G Federated Learning.pdf
Machine Learning 5G Federated Learning.pdf
 
2022 AWS DNA Hackathon 장애 대응 솔루션 jarvis.
2022 AWS DNA Hackathon 장애 대응 솔루션 jarvis.2022 AWS DNA Hackathon 장애 대응 솔루션 jarvis.
2022 AWS DNA Hackathon 장애 대응 솔루션 jarvis.
 
Design and Analysis of Algorithms Lecture Notes
Design and Analysis of Algorithms Lecture NotesDesign and Analysis of Algorithms Lecture Notes
Design and Analysis of Algorithms Lecture Notes
 
priority interrupt computer organization
priority interrupt computer organizationpriority interrupt computer organization
priority interrupt computer organization
 
The Satellite applications in telecommunication
The Satellite applications in telecommunicationThe Satellite applications in telecommunication
The Satellite applications in telecommunication
 
10 AsymmetricKey Cryptography students.pptx
10 AsymmetricKey Cryptography students.pptx10 AsymmetricKey Cryptography students.pptx
10 AsymmetricKey Cryptography students.pptx
 
Cost estimation approach: FP to COCOMO scenario based question
Cost estimation approach: FP to COCOMO scenario based questionCost estimation approach: FP to COCOMO scenario based question
Cost estimation approach: FP to COCOMO scenario based question
 
A brief look at visionOS - How to develop app on Apple's Vision Pro
A brief look at visionOS - How to develop app on Apple's Vision ProA brief look at visionOS - How to develop app on Apple's Vision Pro
A brief look at visionOS - How to develop app on Apple's Vision Pro
 
Curve setting (Basic Mine Surveying)_MI10412MI.pptx
Curve setting (Basic Mine Surveying)_MI10412MI.pptxCurve setting (Basic Mine Surveying)_MI10412MI.pptx
Curve setting (Basic Mine Surveying)_MI10412MI.pptx
 
TEST CASE GENERATION GENERATION BLOCK BOX APPROACH
TEST CASE GENERATION GENERATION BLOCK BOX APPROACHTEST CASE GENERATION GENERATION BLOCK BOX APPROACH
TEST CASE GENERATION GENERATION BLOCK BOX APPROACH
 
FUNCTIONAL AND NON FUNCTIONAL REQUIREMENT
FUNCTIONAL AND NON FUNCTIONAL REQUIREMENTFUNCTIONAL AND NON FUNCTIONAL REQUIREMENT
FUNCTIONAL AND NON FUNCTIONAL REQUIREMENT
 
ASME-B31.4-2019-estandar para diseño de ductos
ASME-B31.4-2019-estandar para diseño de ductosASME-B31.4-2019-estandar para diseño de ductos
ASME-B31.4-2019-estandar para diseño de ductos
 
Secure Key Crypto - Tech Paper JET Tech Labs
Secure Key Crypto - Tech Paper JET Tech LabsSecure Key Crypto - Tech Paper JET Tech Labs
Secure Key Crypto - Tech Paper JET Tech Labs
 
Detection&Tracking - Thermal imaging object detection and tracking
Detection&Tracking - Thermal imaging object detection and trackingDetection&Tracking - Thermal imaging object detection and tracking
Detection&Tracking - Thermal imaging object detection and tracking
 
Theory of Machine Notes / Lecture Material .pdf
Theory of Machine Notes / Lecture Material .pdfTheory of Machine Notes / Lecture Material .pdf
Theory of Machine Notes / Lecture Material .pdf
 
22CYT12 & Chemistry for Computer Systems_Unit-II-Corrosion & its Control Meth...
22CYT12 & Chemistry for Computer Systems_Unit-II-Corrosion & its Control Meth...22CYT12 & Chemistry for Computer Systems_Unit-II-Corrosion & its Control Meth...
22CYT12 & Chemistry for Computer Systems_Unit-II-Corrosion & its Control Meth...
 

Design patterns

  • 1. Design Patterns for software engineering Presented by: Rohan Jain Tanisha Bhayani Akshay Bhanderi Abhay Desale
  • 2. What is design pattern? ● Design patterns are typical solutions to commonly occurring problems in software design. ● They are like pre-made blueprints that you can customize to solve a recurring design problem in your code. ● Types of design pattern ○ Creational Design Patterns ○ Structural Design Patterns ○ Behavioral Design Patterns
  • 3. Creational Design Pattern: Factory Method we create object without exposing the creation logic to client and the client use the same common interface to create new type of object
  • 4. Creational Design Pattern:Abstract Factory Lets you produce families of related objects without specifying their concrete classes.
  • 5. Creational Design Pattern: Builder ● That lets you construct complex objects step by step. ● The pattern allows you to produce different types and representations of an object using the same construction code.
  • 6. Creational Design Pattern: Singleton class Database is private static field instance: Database private constructor Database() is public static method getInstance() is if (Database.instance == null) then acquireThreadLock() and then if (Database.instance == null) then Database.instance = new Database() return Database.instance public method query(sql) is class Application is method main() is Database foo = Database.getInstance() foo.query("SELECT ...") // ... Database bar = Database.getInstance() bar.query("SELECT ...") // The variable `bar` will contain the same object as // the variable `foo`. That lets you ensure that a class has only one instance, while providing a global access point to this instance.
  • 7. Creational Design Pattern: Prototype lets you copy existing objects without making your code dependent on their classes.
  • 8. Structure Design Pattern: Adapter Pattern Scenario: Two incompatible interfaces but the core functionality is same. Class Adapter - Inheritance Object Adapter - Delegation through Composition
  • 9. Structure Design Pattern: Bridge Pattern Scenario: Vary the implementation and the abstraction by placing the two into separate class hierarchies.
  • 10. Structure Design Pattern: Composite Pattern Scenario: When clients ignore the difference between compositions of objects and individual objects.
  • 11. Structure Design Pattern: Decorator Pattern Scenario: Allows behavior to be added to an individual object, dynamically, without affecting the behavior of other objects from the same class.
  • 12. Structure Design Pattern: Facade Pattern Scenario: The client facing interface needs simplification.
  • 13. Structure Design Pattern: Flyweight Pattern Scenario: Minimize memory usage or computational expenses by sharing as much as possible with similar objects.
  • 14. Structure Design Pattern: Proxy Pattern Scenario: When client needs to protect, hide complexity, or delay expensive actions.
  • 15. Anti Pattern ● Applying a particular design pattern in the improper context.
  • 16. Behaviour Pattern ● Behavioral design patterns are concerned with the interaction and responsibility of objects. Behaviour Design Pattern: Chain of Responsibility What it suggests? Pass the request along the chain of handlers instead of one. Control order of request handling
  • 17. Behaviour Design Pattern: Command What is suggets? Turns a request into a stand-alone object that contains all information about the request.
  • 18. Behaviour Design Pattern: Iterator What is suggets? lets you traverse elements of a collection without exposing its underlying representation
  • 19. Behaviour Design Pattern: Meditor What is suggets? This pattern restricts direct communications between the objects and forces them to collaborate only via a mediator object. Increases reusability
  • 20. Behaviour Design Pattern: Template Method What it says? Just define the skeleton of a function in an operation, deferring some steps to its subclasses. Remove duplication
  • 21. Behaviour Design Pattern: Visitor What is says? Visitor lets you define a new operation without changing the classes of the elements on which it operates.
  • 22. Behaviour Design Pattern: Memento Lets you save and restore the previous state of an object without revealing the details of its implementation.
  • 23. Behaviour Design Pattern: Observer Lets you define a subscription mechanism to notify multiple objects about any events that happen to the object they’re observing.
  • 24. Behaviour Design Pattern: State Lets an object alter its behavior when its internal state changes. It appears as if the object changed its class.
  • 25. Behaviour Design Pattern: Strategy Lets you define a family of algorithms, put each of them into a separate class, and make their objects interchangeable. Problem Solution
  • 26. References ● https://refactoring.guru/design-patterns ● https://www.javatpoint.com/design-patterns-in-java ● https://sourcemaking.com/design_patterns ● https://www.youtube.com/watch?v=TeZqKnC2gvA (for visiter) ● https://www.youtube.com/watch?v=7Pj5kAhVBlg ● https://medium.com/educative/the-7-most-important-software-design-patterns-d60e546afb0e ● https://medium.com/federicohaag/coding-better-using-design-patterns-4d7385a9e7ac ● https://www.youtube.com/watch?v=v9ejT8FO-7I&list=PLrhzvIcii6GNjpARdnO4ueTUAVR9eMBpc(Design Pattern Series) ● https://en.wikipedia.org/wiki/Structural_pattern ● https://stackoverflow.com/questions/980601/what-is-an-anti-pattern ● https://dev.to/carlillo/design-patterns---adapter-2pi3 ● https://stackoverflow.com/questions/319728/when-do-you-use-the-bridge-pattern-how-is-it-different-from- adapter-pattern ● https://en.wikipedia.org/wiki/Composite_pattern ● https://en.wikipedia.org/wiki/Decorator_pattern ● https://en.wikipedia.org/wiki/Facade_pattern ● https://www.oreilly.com/library/view/learning-javascript-design/9781449334840/ch09s18.html ● http://www.cs.sjsu.edu/faculty/pearce/modules/patterns/distArch/proxy.htm