SlideShare ist ein Scribd-Unternehmen logo
1 von 18
How I Learned To Apply Design Patterns Andy Maleh Obtiva Corp.
Outline What Are Design Patterns? Gang of Four Design Patterns GRASP Patterns Learning Process Example
What Are Design Patterns? Reusable solutions to common problems encountered at the software design level of abstraction. A pattern usually consists of: Name Problem Solution Consequences
Gang of Four Design Patterns Strategy State Decorator Proxy Abstract Factory Factory Method Chain of Responsibility Visitor???
GRASP Patterns General Responsibility Assignment Software Patterns Appeared in the book "Applying UML and Patterns" by Craig Larman Provide the underpinnings of Object Oriented Design Help explain the benefits of most Gang of Four design patterns as well as how they were arrived to  Contemplated collectively instead of one at a time
GRASP Patterns Creator Information Expert Controller Low Coupling High Cohesion Polymorphism Pure Fabrication Indirection Protected Variations
Responsibility Driven Design Break requirements into use-cases Come up with scenarios for use-cases Figure out responsibilities for each step in a scenario Assign responsibilities to objects based on Object Oriented Design principles NOTE: the methodology is applied vertically in thin slices when following an Agile process
Learning Process Study design patterns with genuine interest to deeply understand them and recognize when applying them would reap benefits in real-world scenarios. Look for every opportunity to apply them to slowly develop a sense of smell for when patterns can be applied. Learn to recognize when a design pattern is absolutely necessary and helpful and when it is just over-engineering.
Example – Order Submission Requirements: When an order is first created, it is not ready for on-line submission as it is missing required information. An order becomes ready for submission once filled in with required information.  A pending order is an order that was interrupted amidst on-line submission. Once an order is submitted, it cannot be edited and resubmitted.
Example – Order Submission Order State Diagram:
Example – Order Submission Design: Each order state is represented with a state object Not Ready Ready Pending Submitted View observes order to update edit and submit button enablements
Example – Order Submission Design Patterns: State Observer
Example – Order Submission GRASP Patterns: Polymorphism  Order States handling behavior polymorphically Indirection Observers provide indirect coupling to order state Protected Variations  Order is protected from state variations Low Coupling Order has low coupling to behavior variation per state View has low coupling to Order via observers
Example – Order Submission Benefits: Order behavior variation across states is clarified Order behavior is easily maintainable in different classes No complicated if/else conditionals
Review What Are Design Patterns? Gang of Four Design Patterns GRASP Patterns Learning Process Example
???
References Design Patterns: Elements of Reusable Object-Oriented Software Authors: Gang of Four ISBN-13: 978-0201633610 Applying UML and Patterns: An Introduction to Object-Oriented Analysis and Design and Iterative Development Author: Craig Larman ISBN-13: 978-0131489066 Recommended Chapters (17, 25, 26) Object Design: Roles, Responsibilities, and Collaborations Author: Rebecca Wirfs-Brock ISBN-13: 978-0201379433 Elephant Carpaccio Author: Alistair Cockburn URL: http://alistair.cockburn.us/Elephant+carpaccio#discussion
Contact Presenter: Andy Maleh Email: andy at obtiva dot com Twitter: AndyMaleh Blog: http://andymaleh.blogspot.com

Weitere ähnliche Inhalte

Was ist angesagt?

GOF Design pattern with java
GOF Design pattern with javaGOF Design pattern with java
GOF Design pattern with javaRajiv Gupta
 
Design patterns ppt
Design patterns pptDesign patterns ppt
Design patterns pptAman Jain
 
Lecture 5 Software Engineering and Design Design Patterns
Lecture 5 Software Engineering and Design Design PatternsLecture 5 Software Engineering and Design Design Patterns
Lecture 5 Software Engineering and Design Design Patternsop205
 
Behavioral pattern By:-Priyanka Pradhan
Behavioral pattern By:-Priyanka PradhanBehavioral pattern By:-Priyanka Pradhan
Behavioral pattern By:-Priyanka PradhanPriyanka Pradhan
 
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
 
Patterns in Python
Patterns in PythonPatterns in Python
Patterns in Pythondn
 
Design pattern
Design patternDesign pattern
Design patternOmar Isaid
 
Design Patterns
Design PatternsDesign Patterns
Design Patternssoms_1
 
Design patterns difference between interview questions
Design patterns   difference between interview questionsDesign patterns   difference between interview questions
Design patterns difference between interview questionsUmar Ali
 
Design Pattern in Software Engineering
Design Pattern in Software EngineeringDesign Pattern in Software Engineering
Design Pattern in Software EngineeringManish Kumar
 

Was ist angesagt? (20)

GOF Design pattern with java
GOF Design pattern with javaGOF Design pattern with java
GOF Design pattern with java
 
Design patterns ppt
Design patterns pptDesign patterns ppt
Design patterns ppt
 
Lecture 5 Software Engineering and Design Design Patterns
Lecture 5 Software Engineering and Design Design PatternsLecture 5 Software Engineering and Design Design Patterns
Lecture 5 Software Engineering and Design Design Patterns
 
Behavioral pattern By:-Priyanka Pradhan
Behavioral pattern By:-Priyanka PradhanBehavioral pattern By:-Priyanka Pradhan
Behavioral pattern By:-Priyanka Pradhan
 
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
 
Patterns in Python
Patterns in PythonPatterns in Python
Patterns in Python
 
Design Pattern
Design PatternDesign Pattern
Design Pattern
 
Design pattern
Design patternDesign pattern
Design pattern
 
Software Design Patterns
Software Design PatternsSoftware Design Patterns
Software Design Patterns
 
Design Patterns
Design PatternsDesign Patterns
Design Patterns
 
Design pattern
Design patternDesign pattern
Design pattern
 
Sda 8
Sda   8Sda   8
Sda 8
 
Design patterns
Design patternsDesign patterns
Design patterns
 
Design Patterns
Design PatternsDesign Patterns
Design Patterns
 
Go f designpatterns 130116024923-phpapp02
Go f designpatterns 130116024923-phpapp02Go f designpatterns 130116024923-phpapp02
Go f designpatterns 130116024923-phpapp02
 
Design patterns difference between interview questions
Design patterns   difference between interview questionsDesign patterns   difference between interview questions
Design patterns difference between interview questions
 
Design patterns
Design patternsDesign patterns
Design patterns
 
L05 Design Patterns
L05 Design PatternsL05 Design Patterns
L05 Design Patterns
 
Design Pattern in Software Engineering
Design Pattern in Software EngineeringDesign Pattern in Software Engineering
Design Pattern in Software Engineering
 
Design patterns tutorials
Design patterns tutorialsDesign patterns tutorials
Design patterns tutorials
 

Ähnlich wie How I Learned To Apply Design Patterns

12266422.ppt
12266422.ppt12266422.ppt
12266422.pptCSEC5
 
Sfeldman performance bb_worldemea07
Sfeldman performance bb_worldemea07Sfeldman performance bb_worldemea07
Sfeldman performance bb_worldemea07Steve Feldman
 
Getting Unstuck: Working with Legacy Code and Data
Getting Unstuck: Working with Legacy Code and DataGetting Unstuck: Working with Legacy Code and Data
Getting Unstuck: Working with Legacy Code and DataCory Foy
 
Code Craftsmanship Checklist
Code Craftsmanship ChecklistCode Craftsmanship Checklist
Code Craftsmanship ChecklistRyan Polk
 
DesignPrinciples-and-DesignPatterns
DesignPrinciples-and-DesignPatternsDesignPrinciples-and-DesignPatterns
DesignPrinciples-and-DesignPatternsBasavaraj Patil
 
The Nature Of Patterns
The Nature Of PatternsThe Nature Of Patterns
The Nature Of PatternsNick Harrison
 
Design Patterns .Net
Design Patterns .NetDesign Patterns .Net
Design Patterns .NetHariom Shah
 
Modeling Requirements Narrated2
Modeling Requirements Narrated2Modeling Requirements Narrated2
Modeling Requirements Narrated2Daniel Brookshier
 
Modeling Requirements with SysML
Modeling Requirements with SysML Modeling Requirements with SysML
Modeling Requirements with SysML Daniel Brookshier
 
B2 2006 sizing_benchmarking
B2 2006 sizing_benchmarkingB2 2006 sizing_benchmarking
B2 2006 sizing_benchmarkingSteve Feldman
 
B2 2006 sizing_benchmarking (1)
B2 2006 sizing_benchmarking (1)B2 2006 sizing_benchmarking (1)
B2 2006 sizing_benchmarking (1)Steve Feldman
 
Object Oriented Analysis and Design with UML2 part2
Object Oriented Analysis and Design with UML2 part2Object Oriented Analysis and Design with UML2 part2
Object Oriented Analysis and Design with UML2 part2Haitham Raik
 
The OO Design Principles
The OO Design PrinciplesThe OO Design Principles
The OO Design PrinciplesSteve Zhang
 
GRASP Principles
GRASP PrinciplesGRASP Principles
GRASP PrinciplesRaheel Arif
 

Ähnlich wie How I Learned To Apply Design Patterns (20)

L03 Design Patterns
L03 Design PatternsL03 Design Patterns
L03 Design Patterns
 
12266422.ppt
12266422.ppt12266422.ppt
12266422.ppt
 
L05 Design Patterns
L05 Design PatternsL05 Design Patterns
L05 Design Patterns
 
Sfeldman performance bb_worldemea07
Sfeldman performance bb_worldemea07Sfeldman performance bb_worldemea07
Sfeldman performance bb_worldemea07
 
Getting Unstuck: Working with Legacy Code and Data
Getting Unstuck: Working with Legacy Code and DataGetting Unstuck: Working with Legacy Code and Data
Getting Unstuck: Working with Legacy Code and Data
 
Code Craftsmanship Checklist
Code Craftsmanship ChecklistCode Craftsmanship Checklist
Code Craftsmanship Checklist
 
DesignPrinciples-and-DesignPatterns
DesignPrinciples-and-DesignPatternsDesignPrinciples-and-DesignPatterns
DesignPrinciples-and-DesignPatterns
 
Slides chapter 3
Slides chapter 3Slides chapter 3
Slides chapter 3
 
Slides chapter 3
Slides chapter 3Slides chapter 3
Slides chapter 3
 
L12 GRASP
L12 GRASPL12 GRASP
L12 GRASP
 
The Nature Of Patterns
The Nature Of PatternsThe Nature Of Patterns
The Nature Of Patterns
 
Design Patterns .Net
Design Patterns .NetDesign Patterns .Net
Design Patterns .Net
 
Modeling Requirements Narrated2
Modeling Requirements Narrated2Modeling Requirements Narrated2
Modeling Requirements Narrated2
 
Modeling Requirements with SysML
Modeling Requirements with SysML Modeling Requirements with SysML
Modeling Requirements with SysML
 
B2 2006 sizing_benchmarking
B2 2006 sizing_benchmarkingB2 2006 sizing_benchmarking
B2 2006 sizing_benchmarking
 
B2 2006 sizing_benchmarking (1)
B2 2006 sizing_benchmarking (1)B2 2006 sizing_benchmarking (1)
B2 2006 sizing_benchmarking (1)
 
Chapter 1
Chapter 1Chapter 1
Chapter 1
 
Object Oriented Analysis and Design with UML2 part2
Object Oriented Analysis and Design with UML2 part2Object Oriented Analysis and Design with UML2 part2
Object Oriented Analysis and Design with UML2 part2
 
The OO Design Principles
The OO Design PrinciplesThe OO Design Principles
The OO Design Principles
 
GRASP Principles
GRASP PrinciplesGRASP Principles
GRASP Principles
 

Mehr von Andy Maleh

Fukuoka Ruby Award 2023 - Opal
Fukuoka Ruby Award 2023 - OpalFukuoka Ruby Award 2023 - Opal
Fukuoka Ruby Award 2023 - OpalAndy Maleh
 
Becoming a SOC2 Ruby Shop - Montreal.rb November, 5, 2022 Ruby Meetup
Becoming a SOC2 Ruby Shop - Montreal.rb November, 5, 2022 Ruby MeetupBecoming a SOC2 Ruby Shop - Montreal.rb November, 5, 2022 Ruby Meetup
Becoming a SOC2 Ruby Shop - Montreal.rb November, 5, 2022 Ruby MeetupAndy Maleh
 
Montreal.rb 2022-10-05 - Glimmer DSL for SWT - Ruby Desktop Development GUI ...
 Montreal.rb 2022-10-05 - Glimmer DSL for SWT - Ruby Desktop Development GUI ... Montreal.rb 2022-10-05 - Glimmer DSL for SWT - Ruby Desktop Development GUI ...
Montreal.rb 2022-10-05 - Glimmer DSL for SWT - Ruby Desktop Development GUI ...Andy Maleh
 
How I Built My Code Editor in Ruby
How I Built My Code Editor in RubyHow I Built My Code Editor in Ruby
How I Built My Code Editor in RubyAndy Maleh
 
Ultra Light and Maintainable Rails Wizards at RailsConf 2014
Ultra Light and Maintainable Rails Wizards at RailsConf 2014Ultra Light and Maintainable Rails Wizards at RailsConf 2014
Ultra Light and Maintainable Rails Wizards at RailsConf 2014Andy Maleh
 
RailsConf 2014 Recap at Montreal.rb by Andy Maleh
RailsConf 2014 Recap at Montreal.rb by Andy MalehRailsConf 2014 Recap at Montreal.rb by Andy Maleh
RailsConf 2014 Recap at Montreal.rb by Andy MalehAndy Maleh
 
Ultra Light and Maintainable Wizards in Rails at Montreal.rb
Ultra Light and Maintainable Wizards in Rails at Montreal.rbUltra Light and Maintainable Wizards in Rails at Montreal.rb
Ultra Light and Maintainable Wizards in Rails at Montreal.rbAndy Maleh
 
Revised Rails Engine Patterns for Montreal.rb meetup Oct 16, 2012
Revised Rails Engine Patterns for Montreal.rb meetup Oct 16, 2012Revised Rails Engine Patterns for Montreal.rb meetup Oct 16, 2012
Revised Rails Engine Patterns for Montreal.rb meetup Oct 16, 2012Andy Maleh
 
Software Craftsmanship VS Software Engineering
Software Craftsmanship VS Software EngineeringSoftware Craftsmanship VS Software Engineering
Software Craftsmanship VS Software EngineeringAndy Maleh
 
Rails Engine Patterns
Rails Engine PatternsRails Engine Patterns
Rails Engine PatternsAndy Maleh
 
Software Craftsmanship vs Software Engineering (Lightning Talk)
Software Craftsmanship vs Software Engineering (Lightning Talk)Software Craftsmanship vs Software Engineering (Lightning Talk)
Software Craftsmanship vs Software Engineering (Lightning Talk)Andy Maleh
 
Software Design Trilogy Part III - Domain Driven Design for Ruby on Rails App...
Software Design Trilogy Part III - Domain Driven Design for Ruby on Rails App...Software Design Trilogy Part III - Domain Driven Design for Ruby on Rails App...
Software Design Trilogy Part III - Domain Driven Design for Ruby on Rails App...Andy Maleh
 
Software Design Trilogy Part II - Design Patterns for Rubyists
Software Design Trilogy Part II - Design Patterns for RubyistsSoftware Design Trilogy Part II - Design Patterns for Rubyists
Software Design Trilogy Part II - Design Patterns for RubyistsAndy Maleh
 
Software Design Trilogy Part I - Responsibility Driven Design for Rubyists
Software Design Trilogy Part I - Responsibility Driven Design for RubyistsSoftware Design Trilogy Part I - Responsibility Driven Design for Rubyists
Software Design Trilogy Part I - Responsibility Driven Design for RubyistsAndy Maleh
 
The Rails Engine That Could - In Motion
The Rails Engine That Could - In MotionThe Rails Engine That Could - In Motion
The Rails Engine That Could - In MotionAndy Maleh
 
The Rails Engine That Could
The Rails Engine That CouldThe Rails Engine That Could
The Rails Engine That CouldAndy Maleh
 
Simplifying Desktop Development With Glimmer
Simplifying Desktop Development With GlimmerSimplifying Desktop Development With Glimmer
Simplifying Desktop Development With GlimmerAndy Maleh
 

Mehr von Andy Maleh (17)

Fukuoka Ruby Award 2023 - Opal
Fukuoka Ruby Award 2023 - OpalFukuoka Ruby Award 2023 - Opal
Fukuoka Ruby Award 2023 - Opal
 
Becoming a SOC2 Ruby Shop - Montreal.rb November, 5, 2022 Ruby Meetup
Becoming a SOC2 Ruby Shop - Montreal.rb November, 5, 2022 Ruby MeetupBecoming a SOC2 Ruby Shop - Montreal.rb November, 5, 2022 Ruby Meetup
Becoming a SOC2 Ruby Shop - Montreal.rb November, 5, 2022 Ruby Meetup
 
Montreal.rb 2022-10-05 - Glimmer DSL for SWT - Ruby Desktop Development GUI ...
 Montreal.rb 2022-10-05 - Glimmer DSL for SWT - Ruby Desktop Development GUI ... Montreal.rb 2022-10-05 - Glimmer DSL for SWT - Ruby Desktop Development GUI ...
Montreal.rb 2022-10-05 - Glimmer DSL for SWT - Ruby Desktop Development GUI ...
 
How I Built My Code Editor in Ruby
How I Built My Code Editor in RubyHow I Built My Code Editor in Ruby
How I Built My Code Editor in Ruby
 
Ultra Light and Maintainable Rails Wizards at RailsConf 2014
Ultra Light and Maintainable Rails Wizards at RailsConf 2014Ultra Light and Maintainable Rails Wizards at RailsConf 2014
Ultra Light and Maintainable Rails Wizards at RailsConf 2014
 
RailsConf 2014 Recap at Montreal.rb by Andy Maleh
RailsConf 2014 Recap at Montreal.rb by Andy MalehRailsConf 2014 Recap at Montreal.rb by Andy Maleh
RailsConf 2014 Recap at Montreal.rb by Andy Maleh
 
Ultra Light and Maintainable Wizards in Rails at Montreal.rb
Ultra Light and Maintainable Wizards in Rails at Montreal.rbUltra Light and Maintainable Wizards in Rails at Montreal.rb
Ultra Light and Maintainable Wizards in Rails at Montreal.rb
 
Revised Rails Engine Patterns for Montreal.rb meetup Oct 16, 2012
Revised Rails Engine Patterns for Montreal.rb meetup Oct 16, 2012Revised Rails Engine Patterns for Montreal.rb meetup Oct 16, 2012
Revised Rails Engine Patterns for Montreal.rb meetup Oct 16, 2012
 
Software Craftsmanship VS Software Engineering
Software Craftsmanship VS Software EngineeringSoftware Craftsmanship VS Software Engineering
Software Craftsmanship VS Software Engineering
 
Rails Engine Patterns
Rails Engine PatternsRails Engine Patterns
Rails Engine Patterns
 
Software Craftsmanship vs Software Engineering (Lightning Talk)
Software Craftsmanship vs Software Engineering (Lightning Talk)Software Craftsmanship vs Software Engineering (Lightning Talk)
Software Craftsmanship vs Software Engineering (Lightning Talk)
 
Software Design Trilogy Part III - Domain Driven Design for Ruby on Rails App...
Software Design Trilogy Part III - Domain Driven Design for Ruby on Rails App...Software Design Trilogy Part III - Domain Driven Design for Ruby on Rails App...
Software Design Trilogy Part III - Domain Driven Design for Ruby on Rails App...
 
Software Design Trilogy Part II - Design Patterns for Rubyists
Software Design Trilogy Part II - Design Patterns for RubyistsSoftware Design Trilogy Part II - Design Patterns for Rubyists
Software Design Trilogy Part II - Design Patterns for Rubyists
 
Software Design Trilogy Part I - Responsibility Driven Design for Rubyists
Software Design Trilogy Part I - Responsibility Driven Design for RubyistsSoftware Design Trilogy Part I - Responsibility Driven Design for Rubyists
Software Design Trilogy Part I - Responsibility Driven Design for Rubyists
 
The Rails Engine That Could - In Motion
The Rails Engine That Could - In MotionThe Rails Engine That Could - In Motion
The Rails Engine That Could - In Motion
 
The Rails Engine That Could
The Rails Engine That CouldThe Rails Engine That Could
The Rails Engine That Could
 
Simplifying Desktop Development With Glimmer
Simplifying Desktop Development With GlimmerSimplifying Desktop Development With Glimmer
Simplifying Desktop Development With Glimmer
 

Kürzlich hochgeladen

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
 
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
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
[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
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
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
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
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
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 

Kürzlich hochgeladen (20)

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
 
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
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
[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
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
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
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
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...
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 

How I Learned To Apply Design Patterns

  • 1. How I Learned To Apply Design Patterns Andy Maleh Obtiva Corp.
  • 2. Outline What Are Design Patterns? Gang of Four Design Patterns GRASP Patterns Learning Process Example
  • 3. What Are Design Patterns? Reusable solutions to common problems encountered at the software design level of abstraction. A pattern usually consists of: Name Problem Solution Consequences
  • 4. Gang of Four Design Patterns Strategy State Decorator Proxy Abstract Factory Factory Method Chain of Responsibility Visitor???
  • 5. GRASP Patterns General Responsibility Assignment Software Patterns Appeared in the book "Applying UML and Patterns" by Craig Larman Provide the underpinnings of Object Oriented Design Help explain the benefits of most Gang of Four design patterns as well as how they were arrived to Contemplated collectively instead of one at a time
  • 6. GRASP Patterns Creator Information Expert Controller Low Coupling High Cohesion Polymorphism Pure Fabrication Indirection Protected Variations
  • 7. Responsibility Driven Design Break requirements into use-cases Come up with scenarios for use-cases Figure out responsibilities for each step in a scenario Assign responsibilities to objects based on Object Oriented Design principles NOTE: the methodology is applied vertically in thin slices when following an Agile process
  • 8. Learning Process Study design patterns with genuine interest to deeply understand them and recognize when applying them would reap benefits in real-world scenarios. Look for every opportunity to apply them to slowly develop a sense of smell for when patterns can be applied. Learn to recognize when a design pattern is absolutely necessary and helpful and when it is just over-engineering.
  • 9. Example – Order Submission Requirements: When an order is first created, it is not ready for on-line submission as it is missing required information. An order becomes ready for submission once filled in with required information. A pending order is an order that was interrupted amidst on-line submission. Once an order is submitted, it cannot be edited and resubmitted.
  • 10. Example – Order Submission Order State Diagram:
  • 11. Example – Order Submission Design: Each order state is represented with a state object Not Ready Ready Pending Submitted View observes order to update edit and submit button enablements
  • 12. Example – Order Submission Design Patterns: State Observer
  • 13. Example – Order Submission GRASP Patterns: Polymorphism Order States handling behavior polymorphically Indirection Observers provide indirect coupling to order state Protected Variations Order is protected from state variations Low Coupling Order has low coupling to behavior variation per state View has low coupling to Order via observers
  • 14. Example – Order Submission Benefits: Order behavior variation across states is clarified Order behavior is easily maintainable in different classes No complicated if/else conditionals
  • 15. Review What Are Design Patterns? Gang of Four Design Patterns GRASP Patterns Learning Process Example
  • 16. ???
  • 17. References Design Patterns: Elements of Reusable Object-Oriented Software Authors: Gang of Four ISBN-13: 978-0201633610 Applying UML and Patterns: An Introduction to Object-Oriented Analysis and Design and Iterative Development Author: Craig Larman ISBN-13: 978-0131489066 Recommended Chapters (17, 25, 26) Object Design: Roles, Responsibilities, and Collaborations Author: Rebecca Wirfs-Brock ISBN-13: 978-0201379433 Elephant Carpaccio Author: Alistair Cockburn URL: http://alistair.cockburn.us/Elephant+carpaccio#discussion
  • 18. Contact Presenter: Andy Maleh Email: andy at obtiva dot com Twitter: AndyMaleh Blog: http://andymaleh.blogspot.com