SlideShare une entreprise Scribd logo
1  sur  21
Design Patterns Abhishek Chatterjee
Agenda ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Introduction ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Coding practices ,[object Object],[object Object],[object Object],[object Object],What is beyond it?
Object Oriented Analysis and Design ,[object Object],[object Object]
Design Patterns – an intro ,[object Object],[object Object],[object Object]
An Orientation Example – Strategy Pattern Duck quack() swim() abstract display() MallardDuck display() RedheadDuck display()  Lots of other types  of ducks
An Orientation Example – Strategy Pattern Duck quack() swim() abstract display() fly() MallardDuck display() RedheadDuck display()  Lots of other types  of ducks
An Orientation Example – Strategy Pattern Duck quack() swim() abstract display() fly() MallardDuck display() RedheadDuck display()  Lots of other types  of ducks
An Orientation Example – Strategy Pattern Duck quack() swim() abstract display() fly() MallardDuck display() RedheadDuck display()  Yay!! I can fly too!!! RubberDuck display()
 
Hey Abbey-Shack…. If you want to try Monster.com’s resume services, now is the time.
Who is going to rescue me now? <<Interfaces>> !!! Yes!!! That’s it! I make an IFlyable interface and RubberDuck doesn’t get to implement it… MallardDuck <<IFlyable>> display() RedheadDuck <<IFlyable>> display()  RubberDuck //You can’t fly! display()  They can’t see me happy  
I… I… I… I have a Question! SimCorp simulates 50 ducks… are you saying you are going to write 50 fly methods? What if there is a change in flying style and it effects 20 ducks… will all 20 ducks change? I am losing money you know…
I thought she was non-technical… ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Strategy Pattern in Action Duck quack() swim() abstract display() MallardDuck IFlyBehavior:FlyWithWings display() RubberDuck IFlyBehavior: DontFly  display()  IFlyBehavior fly() FlyWithWings FlyWithRocket DontFly
Inversion of Control – Dependency Injection ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
The problem with that is… ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],So you thought I couldn’t fly? Wheeee… Look at my rocket boosters!
Constructor Injection ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Q & A
Thank You

Contenu connexe

En vedette

Artificial Intelligence 02 uninformed search
Artificial Intelligence 02 uninformed searchArtificial Intelligence 02 uninformed search
Artificial Intelligence 02 uninformed searchAndres Mendez-Vazquez
 
9.6 El modelado Glaciar
9.6 El modelado Glaciar9.6 El modelado Glaciar
9.6 El modelado GlaciarRaquel Zalba
 
Xtext project and PhDs in Gemany
Xtext project and PhDs in GemanyXtext project and PhDs in Gemany
Xtext project and PhDs in GemanyTech Talks @NSU
 
2014 Best Sports Cars
2014 Best Sports Cars2014 Best Sports Cars
2014 Best Sports CarsEason Chan
 
رهبری تیمهای نوآور
رهبری تیمهای نوآوررهبری تیمهای نوآور
رهبری تیمهای نوآورSina Bagherinezhad
 
Music video audience profile
Music video audience profileMusic video audience profile
Music video audience profileChloé
 
9 einfache Ideen für individuelle Bildmotive
9 einfache Ideen für individuelle Bildmotive9 einfache Ideen für individuelle Bildmotive
9 einfache Ideen für individuelle BildmotiveWebdesign Journal
 
Artificial Intelligence 06.01 introduction bayesian_networks
Artificial Intelligence 06.01 introduction bayesian_networksArtificial Intelligence 06.01 introduction bayesian_networks
Artificial Intelligence 06.01 introduction bayesian_networksAndres Mendez-Vazquez
 

En vedette (12)

Artificial Intelligence 02 uninformed search
Artificial Intelligence 02 uninformed searchArtificial Intelligence 02 uninformed search
Artificial Intelligence 02 uninformed search
 
9.6 El modelado Glaciar
9.6 El modelado Glaciar9.6 El modelado Glaciar
9.6 El modelado Glaciar
 
Xtext project and PhDs in Gemany
Xtext project and PhDs in GemanyXtext project and PhDs in Gemany
Xtext project and PhDs in Gemany
 
2014 Best Sports Cars
2014 Best Sports Cars2014 Best Sports Cars
2014 Best Sports Cars
 
رهبری تیمهای نوآور
رهبری تیمهای نوآوررهبری تیمهای نوآور
رهبری تیمهای نوآور
 
Music video audience profile
Music video audience profileMusic video audience profile
Music video audience profile
 
How to Look at Art
How to Look at ArtHow to Look at Art
How to Look at Art
 
9 einfache Ideen für individuelle Bildmotive
9 einfache Ideen für individuelle Bildmotive9 einfache Ideen für individuelle Bildmotive
9 einfache Ideen für individuelle Bildmotive
 
Pn learning takmin
Pn learning takminPn learning takmin
Pn learning takmin
 
ATA CP-MAT program highlights
ATA CP-MAT program highlightsATA CP-MAT program highlights
ATA CP-MAT program highlights
 
Artificial Intelligence 06.01 introduction bayesian_networks
Artificial Intelligence 06.01 introduction bayesian_networksArtificial Intelligence 06.01 introduction bayesian_networks
Artificial Intelligence 06.01 introduction bayesian_networks
 
Jeff Krongaard - RAYTHEON
Jeff Krongaard - RAYTHEONJeff Krongaard - RAYTHEON
Jeff Krongaard - RAYTHEON
 

Similaire à Introduction to Design Patterns

Dsug 05 02-15 - ScalDI - lightweight DI in Scala
Dsug 05 02-15 - ScalDI - lightweight DI in ScalaDsug 05 02-15 - ScalDI - lightweight DI in Scala
Dsug 05 02-15 - ScalDI - lightweight DI in ScalaUgo Matrangolo
 
Control Structures08
Control Structures08Control Structures08
Control Structures08David Millard
 
Making Steaks from Sacred Cows
Making Steaks from Sacred CowsMaking Steaks from Sacred Cows
Making Steaks from Sacred CowsKevlin Henney
 
Javascript Memory leaks and Performance & Angular
Javascript Memory leaks and Performance & AngularJavascript Memory leaks and Performance & Angular
Javascript Memory leaks and Performance & AngularErik Guzman
 
New Ideas for Old Code - Greach
New Ideas for Old Code - GreachNew Ideas for Old Code - Greach
New Ideas for Old Code - GreachHamletDRC
 
Why the Dark Side should use Swift and a SOLID Architecture
Why the Dark Side should use Swift and a SOLID ArchitectureWhy the Dark Side should use Swift and a SOLID Architecture
Why the Dark Side should use Swift and a SOLID ArchitectureJorge Ortiz
 
Making Steaks from Sacred Cows
Making Steaks from Sacred CowsMaking Steaks from Sacred Cows
Making Steaks from Sacred CowsKevlin Henney
 
Performance #6 threading
Performance #6  threadingPerformance #6  threading
Performance #6 threadingVitali Pekelis
 
The things we don't see – stories of Software, Scala and Akka
The things we don't see – stories of Software, Scala and AkkaThe things we don't see – stories of Software, Scala and Akka
The things we don't see – stories of Software, Scala and AkkaKonrad Malawski
 
Does Java Have a Future After Version 8? (Belfast JUG April 2014)
Does Java Have a Future After Version 8? (Belfast JUG April 2014)Does Java Have a Future After Version 8? (Belfast JUG April 2014)
Does Java Have a Future After Version 8? (Belfast JUG April 2014)Garth Gilmour
 
Justjava 2007 Arquitetura Java EE Paulo Silveira, Phillip Calçado
Justjava 2007 Arquitetura Java EE Paulo Silveira, Phillip CalçadoJustjava 2007 Arquitetura Java EE Paulo Silveira, Phillip Calçado
Justjava 2007 Arquitetura Java EE Paulo Silveira, Phillip CalçadoPaulo Silveira
 
TWINS: OOP and FP - Warburton
TWINS: OOP and FP - WarburtonTWINS: OOP and FP - Warburton
TWINS: OOP and FP - WarburtonCodemotion
 
Everything You Need to Know in Order to Start Using jQuery
Everything You Need to Know in Order to Start Using jQueryEverything You Need to Know in Order to Start Using jQuery
Everything You Need to Know in Order to Start Using jQueryDave Ross
 
Kotlin in practice
Kotlin in practiceKotlin in practice
Kotlin in practice彥彬 洪
 

Similaire à Introduction to Design Patterns (20)

L04 Software Design Examples
L04 Software Design ExamplesL04 Software Design Examples
L04 Software Design Examples
 
10 strategy pattern
10 strategy pattern10 strategy pattern
10 strategy pattern
 
Dsug 05 02-15 - ScalDI - lightweight DI in Scala
Dsug 05 02-15 - ScalDI - lightweight DI in ScalaDsug 05 02-15 - ScalDI - lightweight DI in Scala
Dsug 05 02-15 - ScalDI - lightweight DI in Scala
 
Control Structures08
Control Structures08Control Structures08
Control Structures08
 
GWT Extreme!
GWT Extreme!GWT Extreme!
GWT Extreme!
 
Making Steaks from Sacred Cows
Making Steaks from Sacred CowsMaking Steaks from Sacred Cows
Making Steaks from Sacred Cows
 
Javascript Memory leaks and Performance & Angular
Javascript Memory leaks and Performance & AngularJavascript Memory leaks and Performance & Angular
Javascript Memory leaks and Performance & Angular
 
New Ideas for Old Code - Greach
New Ideas for Old Code - GreachNew Ideas for Old Code - Greach
New Ideas for Old Code - Greach
 
Clojure And Swing
Clojure And SwingClojure And Swing
Clojure And Swing
 
Why the Dark Side should use Swift and a SOLID Architecture
Why the Dark Side should use Swift and a SOLID ArchitectureWhy the Dark Side should use Swift and a SOLID Architecture
Why the Dark Side should use Swift and a SOLID Architecture
 
Intro to AngularJs
Intro to AngularJsIntro to AngularJs
Intro to AngularJs
 
Making Steaks from Sacred Cows
Making Steaks from Sacred CowsMaking Steaks from Sacred Cows
Making Steaks from Sacred Cows
 
Performance #6 threading
Performance #6  threadingPerformance #6  threading
Performance #6 threading
 
The things we don't see – stories of Software, Scala and Akka
The things we don't see – stories of Software, Scala and AkkaThe things we don't see – stories of Software, Scala and Akka
The things we don't see – stories of Software, Scala and Akka
 
Does Java Have a Future After Version 8? (Belfast JUG April 2014)
Does Java Have a Future After Version 8? (Belfast JUG April 2014)Does Java Have a Future After Version 8? (Belfast JUG April 2014)
Does Java Have a Future After Version 8? (Belfast JUG April 2014)
 
Justjava 2007 Arquitetura Java EE Paulo Silveira, Phillip Calçado
Justjava 2007 Arquitetura Java EE Paulo Silveira, Phillip CalçadoJustjava 2007 Arquitetura Java EE Paulo Silveira, Phillip Calçado
Justjava 2007 Arquitetura Java EE Paulo Silveira, Phillip Calçado
 
Robots in Swift
Robots in SwiftRobots in Swift
Robots in Swift
 
TWINS: OOP and FP - Warburton
TWINS: OOP and FP - WarburtonTWINS: OOP and FP - Warburton
TWINS: OOP and FP - Warburton
 
Everything You Need to Know in Order to Start Using jQuery
Everything You Need to Know in Order to Start Using jQueryEverything You Need to Know in Order to Start Using jQuery
Everything You Need to Know in Order to Start Using jQuery
 
Kotlin in practice
Kotlin in practiceKotlin in practice
Kotlin in practice
 

Dernier

Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 

Dernier (20)

Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 

Introduction to Design Patterns

  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7. An Orientation Example – Strategy Pattern Duck quack() swim() abstract display() MallardDuck display() RedheadDuck display() Lots of other types of ducks
  • 8. An Orientation Example – Strategy Pattern Duck quack() swim() abstract display() fly() MallardDuck display() RedheadDuck display() Lots of other types of ducks
  • 9. An Orientation Example – Strategy Pattern Duck quack() swim() abstract display() fly() MallardDuck display() RedheadDuck display() Lots of other types of ducks
  • 10. An Orientation Example – Strategy Pattern Duck quack() swim() abstract display() fly() MallardDuck display() RedheadDuck display() Yay!! I can fly too!!! RubberDuck display()
  • 11.  
  • 12. Hey Abbey-Shack…. If you want to try Monster.com’s resume services, now is the time.
  • 13. Who is going to rescue me now? <<Interfaces>> !!! Yes!!! That’s it! I make an IFlyable interface and RubberDuck doesn’t get to implement it… MallardDuck <<IFlyable>> display() RedheadDuck <<IFlyable>> display() RubberDuck //You can’t fly! display() They can’t see me happy 
  • 14. I… I… I… I have a Question! SimCorp simulates 50 ducks… are you saying you are going to write 50 fly methods? What if there is a change in flying style and it effects 20 ducks… will all 20 ducks change? I am losing money you know…
  • 15.
  • 16. Strategy Pattern in Action Duck quack() swim() abstract display() MallardDuck IFlyBehavior:FlyWithWings display() RubberDuck IFlyBehavior: DontFly display() IFlyBehavior fly() FlyWithWings FlyWithRocket DontFly
  • 17.
  • 18.
  • 19.
  • 20. Q & A