SlideShare une entreprise Scribd logo
1  sur  13
Télécharger pour lire hors ligne
Singleton is not the only
        pattern
               Seb Rose
Software Architect – Requirements Management
           Rational IBM, Edinburgh
A typical CV
The Gang of Four
● Patterns first popularised by Design
  Patterns
  Erich Gamma, Richard Helm, Ralph
  Johnson, John Vlissides
● Published 1995
More followed …
Where did it all
      start?
● Christopher Alexander (1936 -)
● Chemistry & Physics, Trinity, Cambridge,
  1957
● Ph.D. Architecture, Harvard (1st ever
  awarded)
● Professor Architecture, Berkley, 1963
● “Notes on the synthesis of form”, 1964
● First Gold Medal Research, American
  Institute of Architects, 1972
● “A Pattern Language”, 1977
Alexandrian Form
● Picture – archetypical example
● Introductory paragraph - context
● Headline (in bold) – essence of problem
● Body – background, motivation, variations
● Solution (in bold)
● Diagram (of solution)
● [Smaller] related patterns
The Hillside Group
● Promotes patterns in software community
● Formed 1993 by Ward Cunningham,
  Ralph Johnson, Ken Auer, Hal
  Hildebrand, Grady Booch, Kent Beck and
  Jim Coplien
● Cunningham invented Wiki to discuss
  patterns
● Sponsors PLoP conferences & books
● Hillside Group: www.hillside.net
● WikiWikiWeb: www.c2.com
Canonical [GoF] Form
● Name
● Alias(es) [Also known as]
● Context [Applicability]
● Problem [Intent]
● Forces [Motivation]
● Solution [Participants, Structure,
  Collaborations, Implementation]
● Example (optional) [Sample code]
● Resulting context [Consequences]
● Rationale (optional)
● Known uses
● Related patterns
Pattern Languages
● Structured method of describing good
  design practices within a field of expertise
● A network of patterns that call upon one
  another
● Help the designer move from problem to
  problem in a logical way
● Allow for many different paths through the
  design process
Pattern Sequences
● Pattern languages are played out as
  sequences
● Sequences show paths through a
  language
● Commonly illustrated through stories
● Give rise to common design fragments
● Can be shown diagrammatically, or as a
  list
And so, back to Singleton
● “Ensure a class has only one instance, and
  provide a global point of access to it.” – GoF,
  1995
● “[Singleton] invariably causes problems with
  coupling and execution, and is more than a
  little overused” – Henney, 2005
● “How do you provide global variables in
  languages without global variables? Don't.
  Your programs will thank you for taking the
  time to think about design instead.” – Kent
  Beck, 2003
An Alternative
You have this system...
  ● You try globals... well, probably you don't: the one thing you
    learned in school was no globals.
  ● You try for SINGLETON, it is in the book, it is good... but then you
    find you have these nasty ripples... then someone tells you it's a
    bad thing and it's obvious to you.
  ● So you try passing parameters: they overwhelm you.
  ● You refactor a bit (à la Fowler) and before you know it you've got
    ENCAPSULATED CONTEXT.
  ● You carry on down this path, you get more mileage here, but over
    time it starts to look like Foote's BIG BALL OF MUD.
The solution is to reduce the coupling, improve the cohesion, but how?
                                                         Allan Kelly, 2005
Context Encapsulation
             Pattern Language




“Context Encapsulation: Three Stories, a Language and Some Sequences”
                                                    Kevlin Henney, 2006

http://www.two-sdg.demon.co.uk/curbralan/papers/europlop/ContextEncapsulation.pdf

Contenu connexe

Similaire à Singleton is not_the_only_pattern

Discovering patterns
Discovering patternsDiscovering patterns
Discovering patternsZach Dennis
 
downey08semaphores.pdf
downey08semaphores.pdfdowney08semaphores.pdf
downey08semaphores.pdfHiroshi Ono
 
downey08semaphores.pdf
downey08semaphores.pdfdowney08semaphores.pdf
downey08semaphores.pdfHiroshi Ono
 
downey08semaphores.pdf
downey08semaphores.pdfdowney08semaphores.pdf
downey08semaphores.pdfHiroshi Ono
 
downey08semaphores.pdf
downey08semaphores.pdfdowney08semaphores.pdf
downey08semaphores.pdfHiroshi Ono
 
A Timeless Way of Communicating: Alexandrian Pattern Languages
A Timeless Way of Communicating: Alexandrian Pattern LanguagesA Timeless Way of Communicating: Alexandrian Pattern Languages
A Timeless Way of Communicating: Alexandrian Pattern LanguagesJoshua Kerievsky
 
Design Patterns (by Joel Funu at DevCongress 2013)
Design Patterns (by Joel Funu at DevCongress 2013)Design Patterns (by Joel Funu at DevCongress 2013)
Design Patterns (by Joel Funu at DevCongress 2013)DevCongress
 
How2research
How2researchHow2research
How2researchkewuc
 
Clil theory diapos per mindmap
Clil theory   diapos per mindmapClil theory   diapos per mindmap
Clil theory diapos per mindmapjalberi2
 
Clil theory
Clil theoryClil theory
Clil theoryjalberi2
 
Ontology Design Patterns for Linked Data Tutorial at ISWC2016 - Introduction
Ontology Design Patterns for Linked Data Tutorial at ISWC2016 - IntroductionOntology Design Patterns for Linked Data Tutorial at ISWC2016 - Introduction
Ontology Design Patterns for Linked Data Tutorial at ISWC2016 - IntroductionAldo Gangemi
 
Design Patterns Story
Design Patterns StoryDesign Patterns Story
Design Patterns StoryArun A
 
EPFL - PxS, week 3 - creative design
EPFL - PxS, week 3 - creative designEPFL - PxS, week 3 - creative design
EPFL - PxS, week 3 - creative designhendrikknoche
 
Using corpora in instruction
Using corpora in instructionUsing corpora in instruction
Using corpora in instructionJonathan Smart
 
Let's study literature with IT! ideas, projects and tasks.
Let's study literature with IT! ideas, projects and tasks.Let's study literature with IT! ideas, projects and tasks.
Let's study literature with IT! ideas, projects and tasks.Marie-Hélène Fasquel
 
Instructions: Student mini-projects - F.Flöck - ESWC SS 2014
Instructions: Student mini-projects - F.Flöck - ESWC SS 2014 Instructions: Student mini-projects - F.Flöck - ESWC SS 2014
Instructions: Student mini-projects - F.Flöck - ESWC SS 2014 eswcsummerschool
 
Design Patterns in Swift ch0 Introduction
Design Patterns in Swift ch0 IntroductionDesign Patterns in Swift ch0 Introduction
Design Patterns in Swift ch0 IntroductionChihyang Li
 

Similaire à Singleton is not_the_only_pattern (20)

Discovering patterns
Discovering patternsDiscovering patterns
Discovering patterns
 
Design Patterns.ppt
Design Patterns.pptDesign Patterns.ppt
Design Patterns.ppt
 
downey08semaphores.pdf
downey08semaphores.pdfdowney08semaphores.pdf
downey08semaphores.pdf
 
downey08semaphores.pdf
downey08semaphores.pdfdowney08semaphores.pdf
downey08semaphores.pdf
 
downey08semaphores.pdf
downey08semaphores.pdfdowney08semaphores.pdf
downey08semaphores.pdf
 
downey08semaphores.pdf
downey08semaphores.pdfdowney08semaphores.pdf
downey08semaphores.pdf
 
Prewriting techniques
Prewriting techniquesPrewriting techniques
Prewriting techniques
 
A Timeless Way of Communicating: Alexandrian Pattern Languages
A Timeless Way of Communicating: Alexandrian Pattern LanguagesA Timeless Way of Communicating: Alexandrian Pattern Languages
A Timeless Way of Communicating: Alexandrian Pattern Languages
 
Design Patterns (by Joel Funu at DevCongress 2013)
Design Patterns (by Joel Funu at DevCongress 2013)Design Patterns (by Joel Funu at DevCongress 2013)
Design Patterns (by Joel Funu at DevCongress 2013)
 
How2research
How2researchHow2research
How2research
 
Academic writing
Academic writingAcademic writing
Academic writing
 
Clil theory diapos per mindmap
Clil theory   diapos per mindmapClil theory   diapos per mindmap
Clil theory diapos per mindmap
 
Clil theory
Clil theoryClil theory
Clil theory
 
Ontology Design Patterns for Linked Data Tutorial at ISWC2016 - Introduction
Ontology Design Patterns for Linked Data Tutorial at ISWC2016 - IntroductionOntology Design Patterns for Linked Data Tutorial at ISWC2016 - Introduction
Ontology Design Patterns for Linked Data Tutorial at ISWC2016 - Introduction
 
Design Patterns Story
Design Patterns StoryDesign Patterns Story
Design Patterns Story
 
EPFL - PxS, week 3 - creative design
EPFL - PxS, week 3 - creative designEPFL - PxS, week 3 - creative design
EPFL - PxS, week 3 - creative design
 
Using corpora in instruction
Using corpora in instructionUsing corpora in instruction
Using corpora in instruction
 
Let's study literature with IT! ideas, projects and tasks.
Let's study literature with IT! ideas, projects and tasks.Let's study literature with IT! ideas, projects and tasks.
Let's study literature with IT! ideas, projects and tasks.
 
Instructions: Student mini-projects - F.Flöck - ESWC SS 2014
Instructions: Student mini-projects - F.Flöck - ESWC SS 2014 Instructions: Student mini-projects - F.Flöck - ESWC SS 2014
Instructions: Student mini-projects - F.Flöck - ESWC SS 2014
 
Design Patterns in Swift ch0 Introduction
Design Patterns in Swift ch0 IntroductionDesign Patterns in Swift ch0 Introduction
Design Patterns in Swift ch0 Introduction
 

Plus de Seb Rose

Software contracts - Global Enterprise Agile 2023.pdf
Software contracts - Global Enterprise Agile 2023.pdfSoftware contracts - Global Enterprise Agile 2023.pdf
Software contracts - Global Enterprise Agile 2023.pdfSeb Rose
 
Micro-service delivery - without the pitfalls
Micro-service delivery - without the pitfallsMicro-service delivery - without the pitfalls
Micro-service delivery - without the pitfallsSeb Rose
 
DevSecOps - Agile Get-Together 2022.pdf
DevSecOps - Agile Get-Together 2022.pdfDevSecOps - Agile Get-Together 2022.pdf
DevSecOps - Agile Get-Together 2022.pdfSeb Rose
 
Contract testing - Sealights 2022.pdf
Contract testing - Sealights 2022.pdfContract testing - Sealights 2022.pdf
Contract testing - Sealights 2022.pdfSeb Rose
 
Example mapping - slice any story into testable examples - SoCraTes 2022.pdf
Example mapping - slice any story into testable examples - SoCraTes 2022.pdfExample mapping - slice any story into testable examples - SoCraTes 2022.pdf
Example mapping - slice any story into testable examples - SoCraTes 2022.pdfSeb Rose
 
Software testing - learning to walk again (expoQA22)
Software testing - learning to walk again (expoQA22)Software testing - learning to walk again (expoQA22)
Software testing - learning to walk again (expoQA22)Seb Rose
 
DevSecOps - Unicom Agile and DevOps Expo (Adaptive Challenges) 2021
DevSecOps - Unicom Agile and DevOps Expo (Adaptive Challenges) 2021DevSecOps - Unicom Agile and DevOps Expo (Adaptive Challenges) 2021
DevSecOps - Unicom Agile and DevOps Expo (Adaptive Challenges) 2021Seb Rose
 
A brief history of requirements - Unicom 2022
A brief history of requirements  - Unicom 2022A brief history of requirements  - Unicom 2022
A brief history of requirements - Unicom 2022Seb Rose
 
Example mapping (with builds) - ProductWorld 2022
Example mapping (with builds)  - ProductWorld 2022Example mapping (with builds)  - ProductWorld 2022
Example mapping (with builds) - ProductWorld 2022Seb Rose
 
Example mapping - ProductWorld 2022
Example mapping - ProductWorld 2022Example mapping - ProductWorld 2022
Example mapping - ProductWorld 2022Seb Rose
 
No code, low code, machine code QA ATL 2021
No code, low code, machine code   QA ATL 2021No code, low code, machine code   QA ATL 2021
No code, low code, machine code QA ATL 2021Seb Rose
 
No code, low code, machine code QA ATL 2021
No code, low code, machine code   QA ATL 2021No code, low code, machine code   QA ATL 2021
No code, low code, machine code QA ATL 2021Seb Rose
 
No code, low code, machine code - Unicom 2021
No code, low code, machine code -  Unicom 2021No code, low code, machine code -  Unicom 2021
No code, low code, machine code - Unicom 2021Seb Rose
 
BDD: from soup to nuts - The Future of Work Scotland 2021
BDD: from soup to nuts  - The Future of Work Scotland 2021BDD: from soup to nuts  - The Future of Work Scotland 2021
BDD: from soup to nuts - The Future of Work Scotland 2021Seb Rose
 
Contrasting test automation and BDD - 2020
Contrasting test automation and BDD - 2020Contrasting test automation and BDD - 2020
Contrasting test automation and BDD - 2020Seb Rose
 
Are BDD and test automation the same thing? Automation Guild 2021
Are BDD and test automation the same thing?   Automation Guild 2021Are BDD and test automation the same thing?   Automation Guild 2021
Are BDD and test automation the same thing? Automation Guild 2021Seb Rose
 
"Our BDDs are broken!" Lean Agile Exchange 2020
"Our BDDs are broken!"   Lean Agile Exchange 2020"Our BDDs are broken!"   Lean Agile Exchange 2020
"Our BDDs are broken!" Lean Agile Exchange 2020Seb Rose
 
User stories: from good intentions to bad advice - Agile Scotland 2019
User stories: from good intentions to bad advice - Agile Scotland 2019User stories: from good intentions to bad advice - Agile Scotland 2019
User stories: from good intentions to bad advice - Agile Scotland 2019Seb Rose
 
User stories: from good intentions to bad advice - Lean Agile Scotland 2019
User stories: from good intentions to bad advice - Lean Agile Scotland 2019User stories: from good intentions to bad advice - Lean Agile Scotland 2019
User stories: from good intentions to bad advice - Lean Agile Scotland 2019Seb Rose
 
Software contracts or: how I learned to stop worrying and love releasing. Agi...
Software contracts or: how I learned to stop worrying and love releasing. Agi...Software contracts or: how I learned to stop worrying and love releasing. Agi...
Software contracts or: how I learned to stop worrying and love releasing. Agi...Seb Rose
 

Plus de Seb Rose (20)

Software contracts - Global Enterprise Agile 2023.pdf
Software contracts - Global Enterprise Agile 2023.pdfSoftware contracts - Global Enterprise Agile 2023.pdf
Software contracts - Global Enterprise Agile 2023.pdf
 
Micro-service delivery - without the pitfalls
Micro-service delivery - without the pitfallsMicro-service delivery - without the pitfalls
Micro-service delivery - without the pitfalls
 
DevSecOps - Agile Get-Together 2022.pdf
DevSecOps - Agile Get-Together 2022.pdfDevSecOps - Agile Get-Together 2022.pdf
DevSecOps - Agile Get-Together 2022.pdf
 
Contract testing - Sealights 2022.pdf
Contract testing - Sealights 2022.pdfContract testing - Sealights 2022.pdf
Contract testing - Sealights 2022.pdf
 
Example mapping - slice any story into testable examples - SoCraTes 2022.pdf
Example mapping - slice any story into testable examples - SoCraTes 2022.pdfExample mapping - slice any story into testable examples - SoCraTes 2022.pdf
Example mapping - slice any story into testable examples - SoCraTes 2022.pdf
 
Software testing - learning to walk again (expoQA22)
Software testing - learning to walk again (expoQA22)Software testing - learning to walk again (expoQA22)
Software testing - learning to walk again (expoQA22)
 
DevSecOps - Unicom Agile and DevOps Expo (Adaptive Challenges) 2021
DevSecOps - Unicom Agile and DevOps Expo (Adaptive Challenges) 2021DevSecOps - Unicom Agile and DevOps Expo (Adaptive Challenges) 2021
DevSecOps - Unicom Agile and DevOps Expo (Adaptive Challenges) 2021
 
A brief history of requirements - Unicom 2022
A brief history of requirements  - Unicom 2022A brief history of requirements  - Unicom 2022
A brief history of requirements - Unicom 2022
 
Example mapping (with builds) - ProductWorld 2022
Example mapping (with builds)  - ProductWorld 2022Example mapping (with builds)  - ProductWorld 2022
Example mapping (with builds) - ProductWorld 2022
 
Example mapping - ProductWorld 2022
Example mapping - ProductWorld 2022Example mapping - ProductWorld 2022
Example mapping - ProductWorld 2022
 
No code, low code, machine code QA ATL 2021
No code, low code, machine code   QA ATL 2021No code, low code, machine code   QA ATL 2021
No code, low code, machine code QA ATL 2021
 
No code, low code, machine code QA ATL 2021
No code, low code, machine code   QA ATL 2021No code, low code, machine code   QA ATL 2021
No code, low code, machine code QA ATL 2021
 
No code, low code, machine code - Unicom 2021
No code, low code, machine code -  Unicom 2021No code, low code, machine code -  Unicom 2021
No code, low code, machine code - Unicom 2021
 
BDD: from soup to nuts - The Future of Work Scotland 2021
BDD: from soup to nuts  - The Future of Work Scotland 2021BDD: from soup to nuts  - The Future of Work Scotland 2021
BDD: from soup to nuts - The Future of Work Scotland 2021
 
Contrasting test automation and BDD - 2020
Contrasting test automation and BDD - 2020Contrasting test automation and BDD - 2020
Contrasting test automation and BDD - 2020
 
Are BDD and test automation the same thing? Automation Guild 2021
Are BDD and test automation the same thing?   Automation Guild 2021Are BDD and test automation the same thing?   Automation Guild 2021
Are BDD and test automation the same thing? Automation Guild 2021
 
"Our BDDs are broken!" Lean Agile Exchange 2020
"Our BDDs are broken!"   Lean Agile Exchange 2020"Our BDDs are broken!"   Lean Agile Exchange 2020
"Our BDDs are broken!" Lean Agile Exchange 2020
 
User stories: from good intentions to bad advice - Agile Scotland 2019
User stories: from good intentions to bad advice - Agile Scotland 2019User stories: from good intentions to bad advice - Agile Scotland 2019
User stories: from good intentions to bad advice - Agile Scotland 2019
 
User stories: from good intentions to bad advice - Lean Agile Scotland 2019
User stories: from good intentions to bad advice - Lean Agile Scotland 2019User stories: from good intentions to bad advice - Lean Agile Scotland 2019
User stories: from good intentions to bad advice - Lean Agile Scotland 2019
 
Software contracts or: how I learned to stop worrying and love releasing. Agi...
Software contracts or: how I learned to stop worrying and love releasing. Agi...Software contracts or: how I learned to stop worrying and love releasing. Agi...
Software contracts or: how I learned to stop worrying and love releasing. Agi...
 

Dernier

Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 

Dernier (20)

Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 

Singleton is not_the_only_pattern

  • 1. Singleton is not the only pattern Seb Rose Software Architect – Requirements Management Rational IBM, Edinburgh
  • 3. The Gang of Four ● Patterns first popularised by Design Patterns Erich Gamma, Richard Helm, Ralph Johnson, John Vlissides ● Published 1995
  • 5. Where did it all start? ● Christopher Alexander (1936 -) ● Chemistry & Physics, Trinity, Cambridge, 1957 ● Ph.D. Architecture, Harvard (1st ever awarded) ● Professor Architecture, Berkley, 1963 ● “Notes on the synthesis of form”, 1964 ● First Gold Medal Research, American Institute of Architects, 1972 ● “A Pattern Language”, 1977
  • 6. Alexandrian Form ● Picture – archetypical example ● Introductory paragraph - context ● Headline (in bold) – essence of problem ● Body – background, motivation, variations ● Solution (in bold) ● Diagram (of solution) ● [Smaller] related patterns
  • 7. The Hillside Group ● Promotes patterns in software community ● Formed 1993 by Ward Cunningham, Ralph Johnson, Ken Auer, Hal Hildebrand, Grady Booch, Kent Beck and Jim Coplien ● Cunningham invented Wiki to discuss patterns ● Sponsors PLoP conferences & books ● Hillside Group: www.hillside.net ● WikiWikiWeb: www.c2.com
  • 8. Canonical [GoF] Form ● Name ● Alias(es) [Also known as] ● Context [Applicability] ● Problem [Intent] ● Forces [Motivation] ● Solution [Participants, Structure, Collaborations, Implementation] ● Example (optional) [Sample code] ● Resulting context [Consequences] ● Rationale (optional) ● Known uses ● Related patterns
  • 9. Pattern Languages ● Structured method of describing good design practices within a field of expertise ● A network of patterns that call upon one another ● Help the designer move from problem to problem in a logical way ● Allow for many different paths through the design process
  • 10. Pattern Sequences ● Pattern languages are played out as sequences ● Sequences show paths through a language ● Commonly illustrated through stories ● Give rise to common design fragments ● Can be shown diagrammatically, or as a list
  • 11. And so, back to Singleton ● “Ensure a class has only one instance, and provide a global point of access to it.” – GoF, 1995 ● “[Singleton] invariably causes problems with coupling and execution, and is more than a little overused” – Henney, 2005 ● “How do you provide global variables in languages without global variables? Don't. Your programs will thank you for taking the time to think about design instead.” – Kent Beck, 2003
  • 12. An Alternative You have this system... ● You try globals... well, probably you don't: the one thing you learned in school was no globals. ● You try for SINGLETON, it is in the book, it is good... but then you find you have these nasty ripples... then someone tells you it's a bad thing and it's obvious to you. ● So you try passing parameters: they overwhelm you. ● You refactor a bit (à la Fowler) and before you know it you've got ENCAPSULATED CONTEXT. ● You carry on down this path, you get more mileage here, but over time it starts to look like Foote's BIG BALL OF MUD. The solution is to reduce the coupling, improve the cohesion, but how? Allan Kelly, 2005
  • 13. Context Encapsulation Pattern Language “Context Encapsulation: Three Stories, a Language and Some Sequences” Kevlin Henney, 2006 http://www.two-sdg.demon.co.uk/curbralan/papers/europlop/ContextEncapsulation.pdf