SlideShare a Scribd company logo
1 of 30
Colleen Crangle
• Woman in tech throughout the 70s and 80s
• PhD in Philosophy (Logic and the Philosophy of
Language and Science), in follow-up to a BSc
cum laude and an MSc in Computer Science and
Mathematics from South Africa
• Affiliated scholar with the Centre for the Study
of Language and Information at Stanford
University and a partner in a small R&D
business in Silicon Valley, California
Introduction to Design Patterns
Jackie Pollock
Who am I?
• Technical Consultant @ Kainos Software
• Joined June 2006 as Graduate Software
Engineer
• Specialities:
• Document Management
• Workflow

• Scanning
• Integration
Overview
• What are design patterns?
• Why are they useful
• Types of design pattern

• Creational
• Structural
• Behavioural
What is a design pattern?
• General repeatable solution to
commonly occurring problem
• Not a finished design to be transformed
directly into code
• Relationships and interactions between
classes or objects without
implementation specifics
Where did they come from?
• Architectural concept by Christopher
Alexander in 1977
• Ward Cunningham and Kent Beck 1987
“Using pattern languages for objectorientated programmers”
• 1990s Gamma, Helm, Johnson, and
Vlissides. AKA: Gang of Four (GoF)
book “Design Patterns: Elements of
Reusable Object-Oriented Software”
Benefits
• Design reuse
• Uniform design vocabulary
• Enhance understanding, restructuring, &
team communication
• Basis for automation
• Transcends language-centric biases

• Abstracts away from many unimportant
details
Drawbacks
• Require significant tedious & error-prone
human effort to handcraft pattern
implementations / design reuse
• Can be deceptively simple
• May limit design options
• Leaves some important details
unresolved
Creational Patterns
Factory
Creating objects without having to specify
the exact class of object that will be
created – will be determined at runtime
Abstract Factory
Creates family of objects at runtime – each
of which will likely be a Factory in its own
right
Builder
Separates construction of the various
elements from the representation of the
whole therefore same process can create
different variants of theme
Singleton
Only one instance of object across
application. Used to provide single point of
access. Should not be used to replace
global variables
Prototype
Create complex objects by cloning existing ones
and changing required characteristics. Useful when
cost of new objects is prohibitive
Structural Patterns
Adapter
Converts an existing interface into another
that your application can use.
Composite
Treat a group of objects the same way as
a single instance of object. Tree structures
with a has-a relationship
Decorator
Add behaviour to object without affecting
behaviour of other objects from the same
class
Facade
Simplified interface to larger body of code.
Reduces dependencies on inner class
objects, wraps complex product APIs in
manageable layer
Proxy
Placeholder for another object, controlling
access. Used for lazy loading resource
hungry objects
Behavioural Patterns
Command
Turns requests into objects, separating out
the code making the request from the
object performing it
Iterator
Access elements of collection sequentially
without focusing on underlying object
types
Observer
When one object changes state, all
dependent objects notified and updated.
View element of Model-View-Controller
pattern
State
Object alters behaviour when internal state
changes
Word of Caution
Always go for simplistic approach rather
than applying patterns to every situation
If you force-fit a pattern into a situation
where the pattern doesn’t apply, you
are, by definition, not following the pattern
Resources
• Books

• Design Patterns
• Head First Design Patterns
• Design Patterns for Dummies

• Online
• Slideshare

• Pluralsight
• SourceMaking
• Wikipedia

• Image Credits
• Nelleke Verhoeff (Yepr)
Thanks for listening
Any Questions?

j.pollock@kainos.com
@kievia
jackiepollock
Finish
• Any queries?
• WomenWhoCodeBelfast@Gmail.com

• Twitter
• #WomenWhoCodeBelfast
• @WWCBelfast, @nirushika

Looking forward to seeing you at our next event!

More Related Content

Similar to Women Who Code Belfast: Introduction to Design patterns

Similar to Women Who Code Belfast: Introduction to Design patterns (20)

Oops design pattern_amitgupta
Oops design pattern_amitguptaOops design pattern_amitgupta
Oops design pattern_amitgupta
 
OOP design patterns
OOP design patternsOOP design patterns
OOP design patterns
 
Design patterns Structural
Design patterns StructuralDesign patterns Structural
Design patterns Structural
 
Behavioral pattern By:-Priyanka Pradhan
Behavioral pattern By:-Priyanka PradhanBehavioral pattern By:-Priyanka Pradhan
Behavioral pattern By:-Priyanka Pradhan
 
Design patterns in Object oriented analysis and design
Design patterns in Object oriented analysis and designDesign patterns in Object oriented analysis and design
Design patterns in Object oriented analysis and design
 
Design pattern and their application
Design pattern and their applicationDesign pattern and their application
Design pattern and their application
 
Chapter 4_Introduction to Patterns.ppt
Chapter 4_Introduction to Patterns.pptChapter 4_Introduction to Patterns.ppt
Chapter 4_Introduction to Patterns.ppt
 
Chapter 4_Introduction to Patterns.ppt
Chapter 4_Introduction to Patterns.pptChapter 4_Introduction to Patterns.ppt
Chapter 4_Introduction to Patterns.ppt
 
Design Pattern lecture 2
Design Pattern lecture 2Design Pattern lecture 2
Design Pattern lecture 2
 
Design Patterns.ppt
Design Patterns.pptDesign Patterns.ppt
Design Patterns.ppt
 
Software Design Patterns
Software Design PatternsSoftware Design Patterns
Software Design Patterns
 
Software Design Patterns
Software Design PatternsSoftware Design Patterns
Software Design Patterns
 
Gang of Four in Java
Gang of Four in Java Gang of Four in Java
Gang of Four in Java
 
Design pattern
Design patternDesign pattern
Design pattern
 
Software design and Architecture.pptx
Software design and Architecture.pptxSoftware design and Architecture.pptx
Software design and Architecture.pptx
 
Designpattern
DesignpatternDesignpattern
Designpattern
 
Design patterns for fun & profit - CoderCruise 2018
Design patterns for fun & profit - CoderCruise 2018Design patterns for fun & profit - CoderCruise 2018
Design patterns for fun & profit - CoderCruise 2018
 
Design patterns
Design patternsDesign patterns
Design patterns
 
Basic design pattern interview questions
Basic design pattern interview questionsBasic design pattern interview questions
Basic design pattern interview questions
 
UNIT IV DESIGN PATTERNS.pptx
UNIT IV DESIGN PATTERNS.pptxUNIT IV DESIGN PATTERNS.pptx
UNIT IV DESIGN PATTERNS.pptx
 

Recently uploaded

Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Recently uploaded (20)

Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
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
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 

Women Who Code Belfast: Introduction to Design patterns

  • 1.
  • 2. Colleen Crangle • Woman in tech throughout the 70s and 80s • PhD in Philosophy (Logic and the Philosophy of Language and Science), in follow-up to a BSc cum laude and an MSc in Computer Science and Mathematics from South Africa • Affiliated scholar with the Centre for the Study of Language and Information at Stanford University and a partner in a small R&D business in Silicon Valley, California
  • 3. Introduction to Design Patterns Jackie Pollock
  • 4. Who am I? • Technical Consultant @ Kainos Software • Joined June 2006 as Graduate Software Engineer • Specialities: • Document Management • Workflow • Scanning • Integration
  • 5. Overview • What are design patterns? • Why are they useful • Types of design pattern • Creational • Structural • Behavioural
  • 6. What is a design pattern? • General repeatable solution to commonly occurring problem • Not a finished design to be transformed directly into code • Relationships and interactions between classes or objects without implementation specifics
  • 7. Where did they come from? • Architectural concept by Christopher Alexander in 1977 • Ward Cunningham and Kent Beck 1987 “Using pattern languages for objectorientated programmers” • 1990s Gamma, Helm, Johnson, and Vlissides. AKA: Gang of Four (GoF) book “Design Patterns: Elements of Reusable Object-Oriented Software”
  • 8. Benefits • Design reuse • Uniform design vocabulary • Enhance understanding, restructuring, & team communication • Basis for automation • Transcends language-centric biases • Abstracts away from many unimportant details
  • 9. Drawbacks • Require significant tedious & error-prone human effort to handcraft pattern implementations / design reuse • Can be deceptively simple • May limit design options • Leaves some important details unresolved
  • 11. Factory Creating objects without having to specify the exact class of object that will be created – will be determined at runtime
  • 12. Abstract Factory Creates family of objects at runtime – each of which will likely be a Factory in its own right
  • 13. Builder Separates construction of the various elements from the representation of the whole therefore same process can create different variants of theme
  • 14. Singleton Only one instance of object across application. Used to provide single point of access. Should not be used to replace global variables
  • 15. Prototype Create complex objects by cloning existing ones and changing required characteristics. Useful when cost of new objects is prohibitive
  • 17. Adapter Converts an existing interface into another that your application can use.
  • 18. Composite Treat a group of objects the same way as a single instance of object. Tree structures with a has-a relationship
  • 19. Decorator Add behaviour to object without affecting behaviour of other objects from the same class
  • 20. Facade Simplified interface to larger body of code. Reduces dependencies on inner class objects, wraps complex product APIs in manageable layer
  • 21. Proxy Placeholder for another object, controlling access. Used for lazy loading resource hungry objects
  • 23. Command Turns requests into objects, separating out the code making the request from the object performing it
  • 24. Iterator Access elements of collection sequentially without focusing on underlying object types
  • 25. Observer When one object changes state, all dependent objects notified and updated. View element of Model-View-Controller pattern
  • 26. State Object alters behaviour when internal state changes
  • 27. Word of Caution Always go for simplistic approach rather than applying patterns to every situation If you force-fit a pattern into a situation where the pattern doesn’t apply, you are, by definition, not following the pattern
  • 28. Resources • Books • Design Patterns • Head First Design Patterns • Design Patterns for Dummies • Online • Slideshare • Pluralsight • SourceMaking • Wikipedia • Image Credits • Nelleke Verhoeff (Yepr)
  • 29. Thanks for listening Any Questions? j.pollock@kainos.com @kievia jackiepollock
  • 30. Finish • Any queries? • WomenWhoCodeBelfast@Gmail.com • Twitter • #WomenWhoCodeBelfast • @WWCBelfast, @nirushika Looking forward to seeing you at our next event!

Editor's Notes

  1. Creational – concerned with everything about the creation of objectsStructural – how classes and objects are composed to form larger structuresBehavioural – algorithms and assignment of responsibilities between objects
  2. Creational Concerned with everything about the creation of objectsStructural How classes and objects are composed to form larger structuresBehavioural Algorithms and assignment of responsibilities between objects