SlideShare a Scribd company logo
1 of 49
The Evolution of Patterns
    Influences and Examples of Emerging Patterns

                                        Chris Eargle
Chris Eargle
Telerik Developer Evangelist

INETA Director

Microsoft MVP – Visual C#

MCPD, MCTS, etc

kodefuguru.com

kodefuguru@live.com
What is a Pattern?
      An element of reusable software

      Names, motivates, and explains a general design that
      addresses recurring design problems

      Describes the problem, the solution, when to apply the
      solution, and its consequences




3/17/2012                                          3
Implementation Levels
Invisible   Part of the language

Informal    Referred to by name, but must be re-
            implemented for each use

Formal      Implement pattern itself within the
            language
Influences
Language Features

Innovations in Object-Oriented Design

Other Programming Paradigms
Language
Design patterns may be a sign of missing language
features
“16 of 23 patterns have qualitatively
 simpler implementation in Lisp or
Dylan than in C++ for at least some
       uses of each pattern.”
              Peter Norvig
Language Features
Keywords are added to languages

Typically streamlines a process

May be tied to other paradigms
Innovations
Object-Oriented Programming is mature

Sometimes an idea takes hold…
           challenges OO Principles…
                 and takes the community by storm.
Fluent Interfaces
Utilizes method chaining

Defined through the return value of a called method

Self referential - the new context is equivalent to the
last context
Fluent Interfaces
English-readable, left-to-right code

May violate command-query separation with stateful
objects

Terminated through the return of a void context
Paradigms
There is a huge ecosystem of programming languages

Most languages fall into categories other than OO

These slowly make their way into modern OO
languages
Generic
Algorithms use types to be specified later

Reduces duplication

Pioneered by ADA in 1983

May be harder to understand
Terminology
Generics
     Ada, Eiffel, Java, C#, F#, and Visual Basic .NET

Parametric Polymorphism
     ML, Scala and Haskell

Templates
     C++
Functional
Treats computation as the evaluation of functions

Avoids state and mutable data

Roots in lambda calculus
Terminology
first class functions
        functions can be passed as arguments

higher-order functions
      take one or more functions as input
      or outputs a function

combinators
     takes one or more functions as input
     and outputs a function
“a combinator is a function which
 builds program fragments from
      program fragments…”

            John Hughes
Terminology
pure functions
      no side effects, which means the function called
      with the same arguments returns the same result

anonymous functions
     a function defined, and possibly called, without
     being bound to an identifier.

continuation-passing style
      when a function is complete, the computation is
      passed to a continuation function
Singleton
Singleton Pattern
      Restricts class instantiation to one instance

      Useful when only one instance is needed in system

      Some consider this an anti-pattern

      Not the same as a static class




3/17/2012                                             20
Singleton Diagram

        Singleton
                      Retrieves a single,
      <<singleton>>   maintained instance
                      of class.
    - Singleton()
    S+ Instance
Influence on Language
A few modern languages directly implement this
construct
Scala Example

// Singleton uses the object keyword instead of class
object Utilities {
  val test = "Test App"

    def loadImages() = {
      // ...
    }
    def createManager():EntityManager = {
      // ...
    }
}
Lazy Initialization
Lazy Initialization
Delays creation of an object

Use when eager initialization is resource intensive

Often used with a factory method (more later)
Iterator
Iterator Pattern
iterator    an object that provides a standard way to
            examine all element of any collection.

Has a uniform interface for traversing many data
structure without exposing their implementations.

Supports concurrent iteration and element removal.

No need to know the internal structure of collection.
Iterator Diagram
    Aggregate         Client         Iterator
   <<interface>>                  <<interface>>

+ CreateIterator()             + First()
                               + Next()
                               + IsDone()
                               + CurrentItem



  ConcreteAggregate             ConcreteIterator


+ CreateIterator()
Command
Command Pattern
used to represent and encapsulate all the information
needed to call a method at a later time
Terminology
client
         instantiates the command object and provides
         the information required to call the method at a
         later time.

invoker
      decides when the method should be called

receiver
      instance of the class that contains the method's
      code
Command Diagram
            Invoker          Command
                            <<interface>>

                        + Execute()


 Invoker




            Receiver   ConcreteCommand

   + Action()          + Execute()
Fluent Command
      The Execute method return the object

      Enables quick access to return properties



            command.Execute();               var results = command.Execute()
            var results = command.Results;                        .Results;




3/17/2012                                                             33
Delegate Command
Execute is accepted as a function
Factory
Factory Method
Method used to create an object

Used when it is more complex to simply instantiate

Don’t confuse this with abstract factory, a generalized
pattern for building a series of factories

Useful in C# to take advantage of generic inference
Function Factory
Combinators correspond to factory methods for
functions
Factory Function
Utilizes a function to create an object
Strategy
Strategy Pattern
Defines family of algorithms

Encapsulates algorithms to make them
interchangeable
Strategy Diagram
                          Containment          Strategy
    Context                                  <<interface>>
ContextInterface()            Use          AlgorithmInterface()




                          <<implements>>                      <<implements>>


                     ConcreteStrategyA                      ConcreteStrategyB
                     <<implementation>>                     <<implementation>>

                      AlgorithmInterface()                    AlgorithmInterface()
Function Strategy
      When a strategy is required, allow owner to pass in a
      function

      Prevents class explosion

      Enables flexibility




3/17/2012                                           42
Function Strategy

                      Containment     Strategy
     Context                        <<delegate>>
 ContextInterface()      Use
Template Method
Template Pattern
Defines the program skeleton of an algorithm

Encapsulate what changes and make it abstract

Subclasses implement those steps in the algorithm
Template Diagram
         AbstractClass
     A+ PrimitiveOperation1()
     A+ PrimitiveOperation2 ()
     + TemplateMethod()




         ConcreteClass

      + PrimitiveOperation1()
      + PrimitiveOperation2()
Function Template
      Encapsulate what changes into functions

      Allow owner to specify those pieces of the algorithm

      Prevents class explosion




3/17/2012                                          47
References
Online references and source code can be found at
bitly.com/wHIBI0
References
Patterns of Enterprise          Functional thinking: Functional
Application Architecture        design patterns, Part 1
               -Martin Fowler                  -Neal Ford

Revenge of the Nerds            Generalising Monads to Arrows
              -Paul Graham                    -John Hughes

Object World, May 5 1996        Design Patterns: Elements of
               -Peter Norvig    Reusable Object-Oriented
                                Software
                                              -GoF

More Related Content

What's hot

C++ OOP Implementation
C++ OOP ImplementationC++ OOP Implementation
C++ OOP ImplementationFridz Felisco
 
Supporting Design Model Refactoring for Improving Class Responsibility Assign...
Supporting Design Model Refactoring for Improving Class Responsibility Assign...Supporting Design Model Refactoring for Improving Class Responsibility Assign...
Supporting Design Model Refactoring for Improving Class Responsibility Assign...Shinpei Hayashi
 
Extending Rotor with Structural Reflection to support Reflective Languages
Extending Rotor with Structural Reflection to support Reflective LanguagesExtending Rotor with Structural Reflection to support Reflective Languages
Extending Rotor with Structural Reflection to support Reflective Languagesfranciscoortin
 
05 iec t1_s1_oo_ps_session_07
05 iec t1_s1_oo_ps_session_0705 iec t1_s1_oo_ps_session_07
05 iec t1_s1_oo_ps_session_07Niit Care
 
iFL: An Interactive Environment for Understanding Feature Implementations
iFL: An Interactive Environment for Understanding Feature ImplementationsiFL: An Interactive Environment for Understanding Feature Implementations
iFL: An Interactive Environment for Understanding Feature ImplementationsShinpei Hayashi
 
Strategy Design Pattern
Strategy Design PatternStrategy Design Pattern
Strategy Design PatternGanesh Kolhe
 
Software development effort reduction with Co-op
Software development effort reduction with Co-opSoftware development effort reduction with Co-op
Software development effort reduction with Co-oplbergmans
 
Java 8 - An Overview
Java 8 - An OverviewJava 8 - An Overview
Java 8 - An OverviewIndrajit Das
 
Multi-dimensional exploration of API usage - ICPC13 - 21-05-13
Multi-dimensional exploration of API usage - ICPC13 - 21-05-13Multi-dimensional exploration of API usage - ICPC13 - 21-05-13
Multi-dimensional exploration of API usage - ICPC13 - 21-05-13Coen De Roover
 
07 iec t1_s1_oo_ps_session_10
07 iec t1_s1_oo_ps_session_1007 iec t1_s1_oo_ps_session_10
07 iec t1_s1_oo_ps_session_10Niit Care
 
Applicative Logic Meta-Programming as the foundation for Template-based Progr...
Applicative Logic Meta-Programming as the foundation for Template-based Progr...Applicative Logic Meta-Programming as the foundation for Template-based Progr...
Applicative Logic Meta-Programming as the foundation for Template-based Progr...Coen De Roover
 
A Recommender System for Refining Ekeko/X Transformation
A Recommender System for Refining Ekeko/X TransformationA Recommender System for Refining Ekeko/X Transformation
A Recommender System for Refining Ekeko/X TransformationCoen De Roover
 
A Logic Meta-Programming Foundation for Example-Driven Pattern Detection in O...
A Logic Meta-Programming Foundation for Example-Driven Pattern Detection in O...A Logic Meta-Programming Foundation for Example-Driven Pattern Detection in O...
A Logic Meta-Programming Foundation for Example-Driven Pattern Detection in O...Coen De Roover
 
The Function Pointer Tutorials
The Function Pointer TutorialsThe Function Pointer Tutorials
The Function Pointer TutorialsNont Banditwong
 
03 iec t1_s1_oo_ps_session_04
03 iec t1_s1_oo_ps_session_0403 iec t1_s1_oo_ps_session_04
03 iec t1_s1_oo_ps_session_04Niit Care
 
Software design patterns ppt
Software design patterns pptSoftware design patterns ppt
Software design patterns pptmkruthika
 

What's hot (20)

C++ OOP Implementation
C++ OOP ImplementationC++ OOP Implementation
C++ OOP Implementation
 
Supporting Design Model Refactoring for Improving Class Responsibility Assign...
Supporting Design Model Refactoring for Improving Class Responsibility Assign...Supporting Design Model Refactoring for Improving Class Responsibility Assign...
Supporting Design Model Refactoring for Improving Class Responsibility Assign...
 
Extending Rotor with Structural Reflection to support Reflective Languages
Extending Rotor with Structural Reflection to support Reflective LanguagesExtending Rotor with Structural Reflection to support Reflective Languages
Extending Rotor with Structural Reflection to support Reflective Languages
 
05 iec t1_s1_oo_ps_session_07
05 iec t1_s1_oo_ps_session_0705 iec t1_s1_oo_ps_session_07
05 iec t1_s1_oo_ps_session_07
 
iFL: An Interactive Environment for Understanding Feature Implementations
iFL: An Interactive Environment for Understanding Feature ImplementationsiFL: An Interactive Environment for Understanding Feature Implementations
iFL: An Interactive Environment for Understanding Feature Implementations
 
Strategy Design Pattern
Strategy Design PatternStrategy Design Pattern
Strategy Design Pattern
 
Software development effort reduction with Co-op
Software development effort reduction with Co-opSoftware development effort reduction with Co-op
Software development effort reduction with Co-op
 
Understanding Annotations in Java
Understanding Annotations in JavaUnderstanding Annotations in Java
Understanding Annotations in Java
 
C by balaguruswami - e.balagurusamy
C   by balaguruswami - e.balagurusamyC   by balaguruswami - e.balagurusamy
C by balaguruswami - e.balagurusamy
 
Java 8 - An Overview
Java 8 - An OverviewJava 8 - An Overview
Java 8 - An Overview
 
Multi-dimensional exploration of API usage - ICPC13 - 21-05-13
Multi-dimensional exploration of API usage - ICPC13 - 21-05-13Multi-dimensional exploration of API usage - ICPC13 - 21-05-13
Multi-dimensional exploration of API usage - ICPC13 - 21-05-13
 
07 iec t1_s1_oo_ps_session_10
07 iec t1_s1_oo_ps_session_1007 iec t1_s1_oo_ps_session_10
07 iec t1_s1_oo_ps_session_10
 
Applicative Logic Meta-Programming as the foundation for Template-based Progr...
Applicative Logic Meta-Programming as the foundation for Template-based Progr...Applicative Logic Meta-Programming as the foundation for Template-based Progr...
Applicative Logic Meta-Programming as the foundation for Template-based Progr...
 
A Recommender System for Refining Ekeko/X Transformation
A Recommender System for Refining Ekeko/X TransformationA Recommender System for Refining Ekeko/X Transformation
A Recommender System for Refining Ekeko/X Transformation
 
L05 Frameworks
L05 FrameworksL05 Frameworks
L05 Frameworks
 
A Logic Meta-Programming Foundation for Example-Driven Pattern Detection in O...
A Logic Meta-Programming Foundation for Example-Driven Pattern Detection in O...A Logic Meta-Programming Foundation for Example-Driven Pattern Detection in O...
A Logic Meta-Programming Foundation for Example-Driven Pattern Detection in O...
 
The Function Pointer Tutorials
The Function Pointer TutorialsThe Function Pointer Tutorials
The Function Pointer Tutorials
 
Object-oriented Basics
Object-oriented BasicsObject-oriented Basics
Object-oriented Basics
 
03 iec t1_s1_oo_ps_session_04
03 iec t1_s1_oo_ps_session_0403 iec t1_s1_oo_ps_session_04
03 iec t1_s1_oo_ps_session_04
 
Software design patterns ppt
Software design patterns pptSoftware design patterns ppt
Software design patterns ppt
 

Viewers also liked

Mechanisms and patterns of evolution
Mechanisms and patterns  of evolutionMechanisms and patterns  of evolution
Mechanisms and patterns of evolutionCRCourseDev
 
Bio 163 patterns of evolution and genes lmk 2013
Bio 163 patterns of evolution and genes lmk 2013Bio 163 patterns of evolution and genes lmk 2013
Bio 163 patterns of evolution and genes lmk 2013lkocian
 
Evolution natural selection-2011
Evolution natural selection-2011Evolution natural selection-2011
Evolution natural selection-2011paprescott
 
09 patterns of evolution
09 patterns of evolution09 patterns of evolution
09 patterns of evolutionmrtangextrahelp
 
Animal Systematics Lecture 3
Animal Systematics Lecture 3Animal Systematics Lecture 3
Animal Systematics Lecture 3Hamid Ur-Rahman
 

Viewers also liked (7)

Diseases m15 l2
Diseases m15 l2Diseases m15 l2
Diseases m15 l2
 
Mechanisms and patterns of evolution
Mechanisms and patterns  of evolutionMechanisms and patterns  of evolution
Mechanisms and patterns of evolution
 
Bio 163 patterns of evolution and genes lmk 2013
Bio 163 patterns of evolution and genes lmk 2013Bio 163 patterns of evolution and genes lmk 2013
Bio 163 patterns of evolution and genes lmk 2013
 
Evolution natural selection-2011
Evolution natural selection-2011Evolution natural selection-2011
Evolution natural selection-2011
 
09 patterns of evolution
09 patterns of evolution09 patterns of evolution
09 patterns of evolution
 
Animal Systematics Lecture 3
Animal Systematics Lecture 3Animal Systematics Lecture 3
Animal Systematics Lecture 3
 
Microevolution
MicroevolutionMicroevolution
Microevolution
 

Similar to Evolution of Patterns

Prophecy Of Design Patterns
Prophecy Of Design PatternsProphecy Of Design Patterns
Prophecy Of Design Patternspradeepkothiyal
 
Bartlesville Dot Net User Group Design Patterns
Bartlesville Dot Net User Group Design PatternsBartlesville Dot Net User Group Design Patterns
Bartlesville Dot Net User Group Design PatternsJason Townsend, MBA
 
Design Pattern For C# Part 1
Design Pattern For C# Part 1Design Pattern For C# Part 1
Design Pattern For C# Part 1Shahzad
 
P Training Presentation
P Training PresentationP Training Presentation
P Training PresentationGaurav Tyagi
 
ActionScript Design Patterns
ActionScript Design Patterns ActionScript Design Patterns
ActionScript Design Patterns Yoss Cohen
 
Design Pattern Mastery - Momentum Dev Con 19 Apr 2018
Design Pattern Mastery - Momentum Dev Con 19 Apr 2018Design Pattern Mastery - Momentum Dev Con 19 Apr 2018
Design Pattern Mastery - Momentum Dev Con 19 Apr 2018Steven Smith
 
1. Mini seminar intro
1. Mini seminar intro1. Mini seminar intro
1. Mini seminar introLeonid Maslov
 
Introduction To Design Patterns
Introduction To Design PatternsIntroduction To Design Patterns
Introduction To Design Patternssukumarraju6
 
Design Patterns in Cocoa Touch
Design Patterns in Cocoa TouchDesign Patterns in Cocoa Touch
Design Patterns in Cocoa TouchEliah Nikans
 
Design Pattern with Actionscript
Design Pattern with ActionscriptDesign Pattern with Actionscript
Design Pattern with ActionscriptDaniel Swid
 
A brief overview of java frameworks
A brief overview of java frameworksA brief overview of java frameworks
A brief overview of java frameworksMD Sayem Ahmed
 
Framework engineering JCO 2011
Framework engineering JCO 2011Framework engineering JCO 2011
Framework engineering JCO 2011YoungSu Son
 
Patterns (contd)Software Development ProcessDesign patte.docx
Patterns (contd)Software Development ProcessDesign patte.docxPatterns (contd)Software Development ProcessDesign patte.docx
Patterns (contd)Software Development ProcessDesign patte.docxdanhaley45372
 
Common ASP.NET Design Patterns - Telerik India DevCon 2013
Common ASP.NET Design Patterns - Telerik India DevCon 2013Common ASP.NET Design Patterns - Telerik India DevCon 2013
Common ASP.NET Design Patterns - Telerik India DevCon 2013Steven Smith
 
Functional Patterns for C++ Multithreading (C++ Dev Meetup Iasi)
Functional Patterns for C++ Multithreading (C++ Dev Meetup Iasi)Functional Patterns for C++ Multithreading (C++ Dev Meetup Iasi)
Functional Patterns for C++ Multithreading (C++ Dev Meetup Iasi)Ovidiu Farauanu
 
Software Engineering Best Practices @ Nylas
Software Engineering Best Practices @ NylasSoftware Engineering Best Practices @ Nylas
Software Engineering Best Practices @ NylasBen Gotow
 
Software engineering: design for reuse
Software engineering: design for reuseSoftware engineering: design for reuse
Software engineering: design for reuseMarco Brambilla
 

Similar to Evolution of Patterns (20)

Prophecy Of Design Patterns
Prophecy Of Design PatternsProphecy Of Design Patterns
Prophecy Of Design Patterns
 
Bartlesville Dot Net User Group Design Patterns
Bartlesville Dot Net User Group Design PatternsBartlesville Dot Net User Group Design Patterns
Bartlesville Dot Net User Group Design Patterns
 
Design Pattern For C# Part 1
Design Pattern For C# Part 1Design Pattern For C# Part 1
Design Pattern For C# Part 1
 
P Training Presentation
P Training PresentationP Training Presentation
P Training Presentation
 
Design Patterns
Design PatternsDesign Patterns
Design Patterns
 
ActionScript Design Patterns
ActionScript Design Patterns ActionScript Design Patterns
ActionScript Design Patterns
 
Design Pattern Mastery - Momentum Dev Con 19 Apr 2018
Design Pattern Mastery - Momentum Dev Con 19 Apr 2018Design Pattern Mastery - Momentum Dev Con 19 Apr 2018
Design Pattern Mastery - Momentum Dev Con 19 Apr 2018
 
1. Mini seminar intro
1. Mini seminar intro1. Mini seminar intro
1. Mini seminar intro
 
Introduction To Design Patterns
Introduction To Design PatternsIntroduction To Design Patterns
Introduction To Design Patterns
 
Design patterns
Design patternsDesign patterns
Design patterns
 
Design Patterns in Cocoa Touch
Design Patterns in Cocoa TouchDesign Patterns in Cocoa Touch
Design Patterns in Cocoa Touch
 
Design Pattern with Actionscript
Design Pattern with ActionscriptDesign Pattern with Actionscript
Design Pattern with Actionscript
 
A brief overview of java frameworks
A brief overview of java frameworksA brief overview of java frameworks
A brief overview of java frameworks
 
Framework engineering JCO 2011
Framework engineering JCO 2011Framework engineering JCO 2011
Framework engineering JCO 2011
 
Patterns (contd)Software Development ProcessDesign patte.docx
Patterns (contd)Software Development ProcessDesign patte.docxPatterns (contd)Software Development ProcessDesign patte.docx
Patterns (contd)Software Development ProcessDesign patte.docx
 
Common ASP.NET Design Patterns - Telerik India DevCon 2013
Common ASP.NET Design Patterns - Telerik India DevCon 2013Common ASP.NET Design Patterns - Telerik India DevCon 2013
Common ASP.NET Design Patterns - Telerik India DevCon 2013
 
Functional Patterns for C++ Multithreading (C++ Dev Meetup Iasi)
Functional Patterns for C++ Multithreading (C++ Dev Meetup Iasi)Functional Patterns for C++ Multithreading (C++ Dev Meetup Iasi)
Functional Patterns for C++ Multithreading (C++ Dev Meetup Iasi)
 
C sharp
C sharpC sharp
C sharp
 
Software Engineering Best Practices @ Nylas
Software Engineering Best Practices @ NylasSoftware Engineering Best Practices @ Nylas
Software Engineering Best Practices @ Nylas
 
Software engineering: design for reuse
Software engineering: design for reuseSoftware engineering: design for reuse
Software engineering: design for reuse
 

More from Chris Eargle

Bring your existing .net skills to a cms
Bring your existing .net skills to a cmsBring your existing .net skills to a cms
Bring your existing .net skills to a cmsChris Eargle
 
Hidden Gems of the Sitefinity API Webinar
Hidden Gems of the Sitefinity API WebinarHidden Gems of the Sitefinity API Webinar
Hidden Gems of the Sitefinity API WebinarChris Eargle
 
Amp Up Your Visual Studio Productivity
Amp Up Your Visual Studio ProductivityAmp Up Your Visual Studio Productivity
Amp Up Your Visual Studio ProductivityChris Eargle
 
Esoteric LINQ and Structural Madness
Esoteric LINQ and Structural MadnessEsoteric LINQ and Structural Madness
Esoteric LINQ and Structural MadnessChris Eargle
 
Easier with visual studio productivity tools
Easier with visual studio productivity toolsEasier with visual studio productivity tools
Easier with visual studio productivity toolsChris Eargle
 
One Engine Two Tools
One Engine Two ToolsOne Engine Two Tools
One Engine Two ToolsChris Eargle
 
2012 Q1 Tools for Better Code
2012 Q1 Tools for Better Code2012 Q1 Tools for Better Code
2012 Q1 Tools for Better CodeChris Eargle
 
Deep Dive: MVC Controller Architecture
Deep Dive: MVC Controller ArchitectureDeep Dive: MVC Controller Architecture
Deep Dive: MVC Controller ArchitectureChris Eargle
 
Building a multi touch enabled windows 7 point of sale system
Building a multi touch enabled windows 7 point of sale systemBuilding a multi touch enabled windows 7 point of sale system
Building a multi touch enabled windows 7 point of sale systemChris Eargle
 
Monadic Comprehensions and Functional Composition with Query Expressions
Monadic Comprehensions and Functional Composition with Query ExpressionsMonadic Comprehensions and Functional Composition with Query Expressions
Monadic Comprehensions and Functional Composition with Query ExpressionsChris Eargle
 

More from Chris Eargle (11)

Bring your existing .net skills to a cms
Bring your existing .net skills to a cmsBring your existing .net skills to a cms
Bring your existing .net skills to a cms
 
Hidden Gems of the Sitefinity API Webinar
Hidden Gems of the Sitefinity API WebinarHidden Gems of the Sitefinity API Webinar
Hidden Gems of the Sitefinity API Webinar
 
Amp Up Your Visual Studio Productivity
Amp Up Your Visual Studio ProductivityAmp Up Your Visual Studio Productivity
Amp Up Your Visual Studio Productivity
 
Esoteric LINQ and Structural Madness
Esoteric LINQ and Structural MadnessEsoteric LINQ and Structural Madness
Esoteric LINQ and Structural Madness
 
Easier with visual studio productivity tools
Easier with visual studio productivity toolsEasier with visual studio productivity tools
Easier with visual studio productivity tools
 
One Engine Two Tools
One Engine Two ToolsOne Engine Two Tools
One Engine Two Tools
 
2012 Q1 Tools for Better Code
2012 Q1 Tools for Better Code2012 Q1 Tools for Better Code
2012 Q1 Tools for Better Code
 
Deep Dive: MVC Controller Architecture
Deep Dive: MVC Controller ArchitectureDeep Dive: MVC Controller Architecture
Deep Dive: MVC Controller Architecture
 
Building a multi touch enabled windows 7 point of sale system
Building a multi touch enabled windows 7 point of sale systemBuilding a multi touch enabled windows 7 point of sale system
Building a multi touch enabled windows 7 point of sale system
 
Monadic Comprehensions and Functional Composition with Query Expressions
Monadic Comprehensions and Functional Composition with Query ExpressionsMonadic Comprehensions and Functional Composition with Query Expressions
Monadic Comprehensions and Functional Composition with Query Expressions
 
C# Ninjitsu
C# NinjitsuC# Ninjitsu
C# Ninjitsu
 

Recently uploaded

Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructureitnewsafrica
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
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
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integrationmarketing932765
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
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
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxfnnc6jmgwh
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkPixlogix Infotech
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Kaya Weers
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 

Recently uploaded (20)

Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
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
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
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
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App Framework
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 

Evolution of Patterns

  • 1. The Evolution of Patterns Influences and Examples of Emerging Patterns Chris Eargle
  • 2. Chris Eargle Telerik Developer Evangelist INETA Director Microsoft MVP – Visual C# MCPD, MCTS, etc kodefuguru.com kodefuguru@live.com
  • 3. What is a Pattern? An element of reusable software Names, motivates, and explains a general design that addresses recurring design problems Describes the problem, the solution, when to apply the solution, and its consequences 3/17/2012 3
  • 4. Implementation Levels Invisible Part of the language Informal Referred to by name, but must be re- implemented for each use Formal Implement pattern itself within the language
  • 5. Influences Language Features Innovations in Object-Oriented Design Other Programming Paradigms
  • 6. Language Design patterns may be a sign of missing language features
  • 7. “16 of 23 patterns have qualitatively simpler implementation in Lisp or Dylan than in C++ for at least some uses of each pattern.” Peter Norvig
  • 8. Language Features Keywords are added to languages Typically streamlines a process May be tied to other paradigms
  • 9. Innovations Object-Oriented Programming is mature Sometimes an idea takes hold… challenges OO Principles… and takes the community by storm.
  • 10. Fluent Interfaces Utilizes method chaining Defined through the return value of a called method Self referential - the new context is equivalent to the last context
  • 11. Fluent Interfaces English-readable, left-to-right code May violate command-query separation with stateful objects Terminated through the return of a void context
  • 12. Paradigms There is a huge ecosystem of programming languages Most languages fall into categories other than OO These slowly make their way into modern OO languages
  • 13. Generic Algorithms use types to be specified later Reduces duplication Pioneered by ADA in 1983 May be harder to understand
  • 14. Terminology Generics Ada, Eiffel, Java, C#, F#, and Visual Basic .NET Parametric Polymorphism ML, Scala and Haskell Templates C++
  • 15. Functional Treats computation as the evaluation of functions Avoids state and mutable data Roots in lambda calculus
  • 16. Terminology first class functions functions can be passed as arguments higher-order functions take one or more functions as input or outputs a function combinators takes one or more functions as input and outputs a function
  • 17. “a combinator is a function which builds program fragments from program fragments…” John Hughes
  • 18. Terminology pure functions no side effects, which means the function called with the same arguments returns the same result anonymous functions a function defined, and possibly called, without being bound to an identifier. continuation-passing style when a function is complete, the computation is passed to a continuation function
  • 20. Singleton Pattern Restricts class instantiation to one instance Useful when only one instance is needed in system Some consider this an anti-pattern Not the same as a static class 3/17/2012 20
  • 21. Singleton Diagram Singleton Retrieves a single, <<singleton>> maintained instance of class. - Singleton() S+ Instance
  • 22. Influence on Language A few modern languages directly implement this construct
  • 23. Scala Example // Singleton uses the object keyword instead of class object Utilities { val test = "Test App" def loadImages() = { // ... } def createManager():EntityManager = { // ... } }
  • 25. Lazy Initialization Delays creation of an object Use when eager initialization is resource intensive Often used with a factory method (more later)
  • 27. Iterator Pattern iterator an object that provides a standard way to examine all element of any collection. Has a uniform interface for traversing many data structure without exposing their implementations. Supports concurrent iteration and element removal. No need to know the internal structure of collection.
  • 28. Iterator Diagram Aggregate Client Iterator <<interface>> <<interface>> + CreateIterator() + First() + Next() + IsDone() + CurrentItem ConcreteAggregate ConcreteIterator + CreateIterator()
  • 30. Command Pattern used to represent and encapsulate all the information needed to call a method at a later time
  • 31. Terminology client instantiates the command object and provides the information required to call the method at a later time. invoker decides when the method should be called receiver instance of the class that contains the method's code
  • 32. Command Diagram Invoker Command <<interface>> + Execute() Invoker Receiver ConcreteCommand + Action() + Execute()
  • 33. Fluent Command The Execute method return the object Enables quick access to return properties command.Execute(); var results = command.Execute() var results = command.Results; .Results; 3/17/2012 33
  • 34. Delegate Command Execute is accepted as a function
  • 36. Factory Method Method used to create an object Used when it is more complex to simply instantiate Don’t confuse this with abstract factory, a generalized pattern for building a series of factories Useful in C# to take advantage of generic inference
  • 37. Function Factory Combinators correspond to factory methods for functions
  • 38. Factory Function Utilizes a function to create an object
  • 40. Strategy Pattern Defines family of algorithms Encapsulates algorithms to make them interchangeable
  • 41. Strategy Diagram Containment Strategy Context <<interface>> ContextInterface() Use AlgorithmInterface() <<implements>> <<implements>> ConcreteStrategyA ConcreteStrategyB <<implementation>> <<implementation>> AlgorithmInterface() AlgorithmInterface()
  • 42. Function Strategy When a strategy is required, allow owner to pass in a function Prevents class explosion Enables flexibility 3/17/2012 42
  • 43. Function Strategy Containment Strategy Context <<delegate>> ContextInterface() Use
  • 45. Template Pattern Defines the program skeleton of an algorithm Encapsulate what changes and make it abstract Subclasses implement those steps in the algorithm
  • 46. Template Diagram AbstractClass A+ PrimitiveOperation1() A+ PrimitiveOperation2 () + TemplateMethod() ConcreteClass + PrimitiveOperation1() + PrimitiveOperation2()
  • 47. Function Template Encapsulate what changes into functions Allow owner to specify those pieces of the algorithm Prevents class explosion 3/17/2012 47
  • 48. References Online references and source code can be found at bitly.com/wHIBI0
  • 49. References Patterns of Enterprise Functional thinking: Functional Application Architecture design patterns, Part 1 -Martin Fowler -Neal Ford Revenge of the Nerds Generalising Monads to Arrows -Paul Graham -John Hughes Object World, May 5 1996 Design Patterns: Elements of -Peter Norvig Reusable Object-Oriented Software -GoF

Editor's Notes

  1. These three levels are from Peter Norvig’s articles in Object World.
  2. generic programming is a style of computer programming in which algorithms are written in terms of to-be-specified-later types that are then instantiated when needed for specific types provided as parameters. This approach, pioneered by Ada in 1983, permits writing common functions or types that differ only in the set of types on which they operate when used, thus reducing duplication. The Gang of Four noted that this technique, especially when combined with delegation, is very powerful but that &quot;[dynamic], highly parameterized software is harder to understand than more static software.&quot;[1]