Patterns In Your PastryPatterns In Your Pastry
Image credit:Image credit: EvelynGiggles (EvelynIsHere)EvelynGiggles (EvelynIsHere) - http://www.flickr.com/photos/evelynishere/3662124836- http://www.flickr.com/photos/evelynishere/3662124836
James Watts
james.watts @ cakephp.org
CakeFest 2013: The CakePHP Conference
August 31st
, 2013 – San Francisco, USA
WARNINGWARNING
Image credit:Image credit: Vegan Feast Catering (VeganFeast)Vegan Feast Catering (VeganFeast) - http://www.flickr.com/photos/veganfeast/4139656092- http://www.flickr.com/photos/veganfeast/4139656092
WARNINGWARNING
You may feel hungryYou may feel hungry
at some point duringat some point during
this presentationthis presentation
Image credit:Image credit: Vegan Feast Catering (VeganFeast)Vegan Feast Catering (VeganFeast) - http://www.flickr.com/photos/veganfeast/4139656092- http://www.flickr.com/photos/veganfeast/4139656092
Design PatternsDesign Patterns
Image credit:Image credit: Andrew Michaels (dragontomato)Andrew Michaels (dragontomato) - http://www.flickr.com/photos/dragontomato/3050561189- http://www.flickr.com/photos/dragontomato/3050561189
There are many!There are many!
Image credit:Image credit: James Lee (jronaldlee)James Lee (jronaldlee) - http://www.flickr.com/photos/jronaldlee/7033839441- http://www.flickr.com/photos/jronaldlee/7033839441
Image source:Image source: AmazonAmazon - http://www.amazon.com/Design-Patterns-Elements-Reusable-Object-Oriented/dp/0201633612- http://www.amazon.com/Design-Patterns-Elements-Reusable-Object-Oriented/dp/0201633612
MVCMVC
Image credit:Image credit: Helen (afeitar)Helen (afeitar) - http://www.flickr.com/photos/afeitar/8039909030- http://www.flickr.com/photos/afeitar/8039909030
- M
- V
- C
- Model
- V
- C
- Model
- View
- C
- Model
- View
- Controller
- Business
- Presentation
- Mediation
- Business
- Presentation
- Mediation
- Business
- Presentation
- Mediation
“ separation of concerns ”
Neither layer . . .
Neither layer . . .
- wants to know
Neither layer . . .
- wants to know
- should know
Neither layer . . .
- wants to know
- should know
- or can know
Neither layer . . .
- wants to know
- should know
- or can know
about the other
Front ControllerFront Controller
Image credit:Image credit: Zrendavir_ (zrendavir)Zrendavir_ (zrendavir) - http://www.flickr.com/photos/zrendavir/3074941476- http://www.flickr.com/photos/zrendavir/3074941476
Single Point of Entry
Single Point of Entry
Obvious Jokes Omitted
Patterns in your Pastry
Template MethodTemplate Method
Image credit:Image credit: Phil and Pam Gradwell (philandpam)Phil and Pam Gradwell (philandpam) - http://www.flickr.com/photos/philandpam/2195674013- http://www.flickr.com/photos/philandpam/2195674013
Override steps
Of a process
Without Modifying
The Process
“ Hooks “
Patterns in your Pastry
FactoryFactory
Image credit:Image credit: Philippe Du Berger (DubyDub2009)Philippe Du Berger (DubyDub2009) - http://www.flickr.com/photos/urbexplo/4360787743- http://www.flickr.com/photos/urbexplo/4360787743
Create an Object
Without exposing
Instantiation logic
Animal
Animal
Cat
Animal Dog
Cat
Animal Dog
Cat
Moose
Animal Factory
Create ( 'dog' )
Patterns in your Pastry
Patterns in your Pastry
UtilityUtility
Image credit:Image credit: Kiran Foster (rueful)Kiran Foster (rueful) - http://www.flickr.com/photos/rueful/5697846897- http://www.flickr.com/photos/rueful/5697846897
Don't Require
Instantiation
Static
Patterns in your Pastry
Active RecordActive Record
Image credit:Image credit: Marcin Wichary (mwichary)Marcin Wichary (mwichary) - http://www.flickr.com/photos/mwichary/2481681915- http://www.flickr.com/photos/mwichary/2481681915
ORM
ORM
Object Relational Mapping
Database Row = Object
Array
CRUD
CRUD
Create, Read, Update, Delete
Patterns in your Pastry
DecoratorDecorator
Image credit:Image credit: U.S. Army Corps of Engineers (usacehq)U.S. Army Corps of Engineers (usacehq) - http://www.flickr.com/photos/usacehq/8723898265- http://www.flickr.com/photos/usacehq/8723898265
Add Behaviors
To an Object
Without Modifying
Other Instances
“ MIXIN “ OR “ TRAIT “
Patterns in your Pastry
SingletonSingleton
Image credit:Image credit: Kevin Jones (kj-an)Kevin Jones (kj-an) - http://www.flickr.com/photos/kj-an/2294604279- http://www.flickr.com/photos/kj-an/2294604279
There can only be one
Only Allow a
Single Instance
Patterns in your Pastry
Patterns in your Pastry
StrategyStrategy
Image credit:Image credit: Lucas Arts/Walt DisneyLucas Arts/Walt Disney
Change a Process
Based on Criteria
Common Interface
Variable process
Patterns in your Pastry
AdaptorAdaptor
Image credit:Image credit: gwire (gwire)gwire (gwire) - http://www.flickr.com/photos/gwire/336458831- http://www.flickr.com/photos/gwire/336458831
Adapts an Interface
Normalization
“ Wrapper ”
Patterns in your Pastry
ObserverObserver
Image credit:Image credit: nociveglia (gwire)nociveglia (gwire) - http://www.flickr.com/photos/40385177@N07/4256525264- http://www.flickr.com/photos/40385177@N07/4256525264
Notifications
State Change
Event Driven
Patterns in your Pastry

More Related Content

PPT
Simple machines
PPTX
My i spy
PPTX
Pp presentation for thursday 5 4-10[1]
PPT
Anderson_Jamar_IgniteSlideShare
ODP
The 3 Little Pigs Presintaion #11
PPT
Our students won_t_research_the_way_we_did
PPT
Social apps-late-2012
PPTX
Libraries and Innovation: Creating environments for encouraging and supportin...
Simple machines
My i spy
Pp presentation for thursday 5 4-10[1]
Anderson_Jamar_IgniteSlideShare
The 3 Little Pigs Presintaion #11
Our students won_t_research_the_way_we_did
Social apps-late-2012
Libraries and Innovation: Creating environments for encouraging and supportin...

What's hot (17)

PDF
TEDx Seattle 2013
PPTX
Researching in science
PPT
PDF
DevOps is Not Enough
PPTX
Edu Blogs
PPT
Bilby report by Annabelle
PPTX
Random People
PPTX
Lets face it...
PPTX
Child Soldiers
PPTX
Alex's Veterans' Issues Presentation, 7th period
PPT
The Social Media Conversation
PDF
Growing Grails Software, Driven by Domain
PPTX
Genocide in Rwanda Chandler
PPTX
Shauntee Issues in Africa 4th
PPTX
Crohn's disease
PPTX
Words related to diseases
TEDx Seattle 2013
Researching in science
DevOps is Not Enough
Edu Blogs
Bilby report by Annabelle
Random People
Lets face it...
Child Soldiers
Alex's Veterans' Issues Presentation, 7th period
The Social Media Conversation
Growing Grails Software, Driven by Domain
Genocide in Rwanda Chandler
Shauntee Issues in Africa 4th
Crohn's disease
Words related to diseases
Ad

Viewers also liked (20)

PPTX
PPTX
Puff pastry
PPTX
Puff pastry applications
PDF
Daidjest dlya rieltorov_9_july_2016
PDF
Enterprise Cake
PDF
TDL EC eng
PDF
Development is a Piece of Cake
PDF
Katalog produk juknis dak bkkbn 2014
PDF
TDL EC
PDF
CakePHP Community Keynote 2013
PDF
Genre Kits BKKbN 2014 ~ PAKET PENYULUHAN GENRE KIT BKKBN 2014 ~ GenRe Kit BKK...
PDF
Daidjest dlya rieltorov_10_august_2016
PPTX
Product and packaging
PPTX
Food safety-training-for-agencies-2012
PDF
CakePHP Community Keynote 2014
Puff pastry
Puff pastry applications
Daidjest dlya rieltorov_9_july_2016
Enterprise Cake
TDL EC eng
Development is a Piece of Cake
Katalog produk juknis dak bkkbn 2014
TDL EC
CakePHP Community Keynote 2013
Genre Kits BKKbN 2014 ~ PAKET PENYULUHAN GENRE KIT BKKBN 2014 ~ GenRe Kit BKK...
Daidjest dlya rieltorov_10_august_2016
Product and packaging
Food safety-training-for-agencies-2012
CakePHP Community Keynote 2014
Ad

Similar to Patterns in your Pastry (20)

PDF
Introduction to Object Oriented Design
PDF
Your first 5 PHP design patterns - ThatConference 2012
PDF
Design patterns illustrated-2015-03
PDF
Software Patterns
PDF
Design patterns by example
PPTX
GoF Design patterns I: Introduction + Structural Patterns
PPTX
Design patterns - The Good, the Bad, and the Anti-Pattern
PDF
Learning Php Design Patterns William Sanders
PDF
Design patterns illustrated 010PHP
PPTX
Design Patterns
PDF
Clean Code V2
PDF
[DevDay 2016] Design Pattern at a glance - Speaker: Tuan Do – Scrum Master a...
PDF
Beyond design patterns phpnw14
PPTX
Large Components in the Rearview Mirror
PDF
Confoo 2011 - Advanced OO Patterns
PPTX
Software Development Practices in Practice
PDF
Clean Architectures in Python.pdf
PPTX
PPTX
Cs690 object oriented_software_engineering_team01_ report
PPTX
Software System Architecture-Lecture 6.pptx
Introduction to Object Oriented Design
Your first 5 PHP design patterns - ThatConference 2012
Design patterns illustrated-2015-03
Software Patterns
Design patterns by example
GoF Design patterns I: Introduction + Structural Patterns
Design patterns - The Good, the Bad, and the Anti-Pattern
Learning Php Design Patterns William Sanders
Design patterns illustrated 010PHP
Design Patterns
Clean Code V2
[DevDay 2016] Design Pattern at a glance - Speaker: Tuan Do – Scrum Master a...
Beyond design patterns phpnw14
Large Components in the Rearview Mirror
Confoo 2011 - Advanced OO Patterns
Software Development Practices in Practice
Clean Architectures in Python.pdf
Cs690 object oriented_software_engineering_team01_ report
Software System Architecture-Lecture 6.pptx

Recently uploaded (20)

PDF
Hindi spoken digit analysis for native and non-native speakers
PDF
Five Habits of High-Impact Board Members
PPT
What is a Computer? Input Devices /output devices
PDF
A novel scalable deep ensemble learning framework for big data classification...
PDF
August Patch Tuesday
PDF
Getting Started with Data Integration: FME Form 101
PDF
Developing a website for English-speaking practice to English as a foreign la...
PDF
A contest of sentiment analysis: k-nearest neighbor versus neural network
PDF
Univ-Connecticut-ChatGPT-Presentaion.pdf
PDF
CloudStack 4.21: First Look Webinar slides
PDF
STKI Israel Market Study 2025 version august
PDF
DP Operators-handbook-extract for the Mautical Institute
PPTX
The various Industrial Revolutions .pptx
PDF
Hybrid model detection and classification of lung cancer
PDF
Getting started with AI Agents and Multi-Agent Systems
PPTX
Chapter 5: Probability Theory and Statistics
PDF
Zenith AI: Advanced Artificial Intelligence
PPTX
Benefits of Physical activity for teenagers.pptx
PDF
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
DOCX
search engine optimization ppt fir known well about this
Hindi spoken digit analysis for native and non-native speakers
Five Habits of High-Impact Board Members
What is a Computer? Input Devices /output devices
A novel scalable deep ensemble learning framework for big data classification...
August Patch Tuesday
Getting Started with Data Integration: FME Form 101
Developing a website for English-speaking practice to English as a foreign la...
A contest of sentiment analysis: k-nearest neighbor versus neural network
Univ-Connecticut-ChatGPT-Presentaion.pdf
CloudStack 4.21: First Look Webinar slides
STKI Israel Market Study 2025 version august
DP Operators-handbook-extract for the Mautical Institute
The various Industrial Revolutions .pptx
Hybrid model detection and classification of lung cancer
Getting started with AI Agents and Multi-Agent Systems
Chapter 5: Probability Theory and Statistics
Zenith AI: Advanced Artificial Intelligence
Benefits of Physical activity for teenagers.pptx
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
search engine optimization ppt fir known well about this

Patterns in your Pastry