SlideShare ist ein Scribd-Unternehmen logo
1 von 27
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?

Weitere ähnliche Inhalte

Was ist angesagt?

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
 

Was ist angesagt? (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
 

Ähnlich wie 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
 

Ähnlich wie 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
 

Kürzlich hochgeladen

Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfJiananWang21
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...roncy bisnoi
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
UNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICS
UNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICSUNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICS
UNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICSrknatarajan
 
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank  Design by Working Stress - IS Method.pdfIntze Overhead Water Tank  Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank Design by Working Stress - IS Method.pdfSuman Jyoti
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduitsrknatarajan
 
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Bookingroncy bisnoi
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Christo Ananth
 
Vivazz, Mieres Social Housing Design Spain
Vivazz, Mieres Social Housing Design SpainVivazz, Mieres Social Housing Design Spain
Vivazz, Mieres Social Housing Design Spaintimesproduction05
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTbhaskargani46
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfKamal Acharya
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performancesivaprakash250
 
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELLPVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELLManishPatel169454
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingrknatarajan
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Bookingdharasingh5698
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptDineshKumar4165
 
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxfenichawla
 

Kürzlich hochgeladen (20)

Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
UNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICS
UNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICSUNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICS
UNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICS
 
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank  Design by Working Stress - IS Method.pdfIntze Overhead Water Tank  Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduits
 
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
 
Vivazz, Mieres Social Housing Design Spain
Vivazz, Mieres Social Housing Design SpainVivazz, Mieres Social Housing Design Spain
Vivazz, Mieres Social Housing Design Spain
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELLPVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
 
NFPA 5000 2024 standard .
NFPA 5000 2024 standard                                  .NFPA 5000 2024 standard                                  .
NFPA 5000 2024 standard .
 

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