SlideShare a Scribd company logo
1 of 69
@gfraiteur
a fresh view on design patterns, programming languages,
and agile methodologies
Design Pattern Automation
Gaël Fraiteur
PostSharp Technologies
Founder & Principal Engineer
@gfraiteur
Hello!
My name is GAEL.
No, I don’t think
my accent is funny.
my twitter
@gfraiteur
My commitment to you:
to seed a vision, not to sell a tool.
@gfraiteur
The vision:
Code at the right level of abstraction,
with compiler-supported design patterns
@gfraiteur
NotifyPropertyChanged,
the wrong way
LAB 1
@gfraiteur
1. A history of programming
languages and patterns
2. Defining Design Pattern Automation
3. Pattern-Oriented Software Development
4. Tools for Design Pattern Automation
5. Agile Methodologies and Patterns
6. A last example
7. Q&A
8. Summary
Section
@gfraiteur
Univac Assembly Language
@gfraiteur
FORTRAN (1955)
• 1955 - FORTRAN I
• Global Variables
• Arrays
• 1958 - FORTRAN II
• Procedural Programming
(no recursion)
• Modules
@gfraiteur
COBOL (1959)
• Data Structures
• Natural Language
@gfraiteur
LISP (1959)
• Variable Scopes (Stack)
• Garbage Collection
@gfraiteur
Simula (1967)
• Classes as
abstraction mechanism
• Virtual procedures
• Object references
• Coroutines
Begin
Class Glyph;
Virtual: Procedure print Is Procedure print;
Begin
End;
Glyph Class Char (c);
Character c;
Begin
Procedure print;
OutChar(c);
End;
Glyph Class Line (elements);
Ref (Glyph) Array elements;
Begin
Procedure print;
Begin
Integer i;
For i:= 1 Step 1 Until UpperBound (elements, 1) Do
elements (i).print;
OutImage;
End;
End;
Ref (Glyph) rg;
Ref (Glyph) Array rgs (1 : 4);
! Main program;
rgs (1):- New Char ('A');
rgs (2):- New Char ('b');
rgs (3):- New Char ('b');
rgs (4):- New Char ('a');
rg:- New Line (rgs);
rg.print;
End;
@gfraiteurCopyright © by Arild Vågen
Human Language
Cognition
Communication
Social Organization
Machine Language
Execution
Programming Languages
@gfraiteurHolašovice, Czech Republic
How is it possible that any simple farmer could make a
house, a thousand times more beautiful than all the
struggling architects of the last fifty years could do?
Christopher Alexander
in The Timeless Way of Building, 1977
Pattern Thinking (1977)
@gfraiteur
A world of
patterns
LANGUAGE
REGULARITY
RESOLUTION
OF FORCES
SELF-
SUSTAINABILITY
VARIETY UBIQUITY
@gfraiteurLanguage Enables Cognition
@gfraiteur
Copyright ©
Stijn NieuwendijkLanguage Enables Communication
@gfraiteurLanguage for the Trade
@gfraiteur
Patterns as
WISDOM
in canonical form
• Name
• Also Known As
• Problem
• Context
• Forces
• Example
• Solution
• Structure and Dynamics
• Implementation
• Example Resolved
• Known Uses
• Variants
• Consequences
• Relationships
• Name
• Also Known As
• Problem
• Context
• Forces
• Example
• Solution
• Structure and Dynamics
• Implementation
• Example Resolved
• Known Uses
• Variants
• Consequences
• Relationships
• Name
• Also Known As
• Problem
• Context
• Forces
• Example
• Solution
• Structure and Dynamics
• Implementation
• Example Resolved
• Known Uses
• Variants
• Consequences
• Relationships
• Name
• Also Known As
• Problem
• Context
• Forces
• Example
• Solution
• Description
• Example Resolved
• Known Uses
• Variants
• Consequences
• Relationships
@gfraiteur
Software Patterns (1995)
• Apply to OO design
• Canonic pattern description
• First catalogue of
23 patterns
@gfraiteur
In 2013, eighteen years later, design patterns still live in
their parent’s house – books.
@gfraiteur
Latent Redundancy
Bad OO code Good OO code Ideal code
Intrinsic variability Latent redundancy Bad redundancy
@gfraiteur
Cost of low abstraction
• Boilerplate code
• More bugs
• Code review
• Changing the pattern implementation
@gfraiteur
1. A history of programming languages and patterns
2. Defining Design Pattern
Automation
3. Pattern-Oriented Software Development
4. Tools for Design Pattern Automation
5. Agile Methodologies and Patterns
6. A last example
7. Q&A
8. Summary
Section
@gfraiteur
Pattern Automation
Automation
is the use of
machines, control systems
and information technologies
to optimize productivity in
the production of goods and
delivery of services.
Wikipedia
Design Pattern Automation
is the use of tools to optimize
productivity in the
implementation of software
based on patterns.
@gfraiteur
Pattern-Aware Compilers allow for coding at the level of
abstraction of design patterns.
@gfraiteur
Design Pattern Automation is new
© hellraiser
MYTH 1
@gfraiteur
Pattern C# Keyword
Dispose using
Lock lock
Publish-Subscribe event
C# implements several patterns
TRUTH 1
@gfraiteur
But C# does not let you
implement your own patterns.
@gfraiteur
code generators were proved wrong
You can’t automate patterns because…
MYTH 2
@gfraiteur
pattern-aware programming languages
and compilers
we don’t need code generators but
TRUTH 2
@gfraiteur
there are too many skills involved
You can’t automate patterns because…
MYTH 3
@gfraiteur
industrial revolution
Skill scarcity motivated the
TRUTH 3
@gfraiteur
Our own industrial revolution:
Making it easier
to build good software
@gfraiteur
1. A history of programming languages and patterns
2. Defining Design Pattern Automation
3.Pattern-Oriented Software
Development
4. Tools for Design Pattern Automation
5. Agile Methodologies and Patterns
6. A last example
7. Q&A
8. Summary
Section
@gfraiteur
they are way too complex general abstract
You can’t automate patterns because…
MYTH 4
@gfraiteur
a normal part of any engineering process
Making abstract things concrete is
TRUTH 4
ConcreteAbstract
Automatable
Non-
Automatable
@gfraiteur
Pattern-Oriented
Implementation Process
Architecture
Pattern
• Defines Subsystems
Design Pattern
• Define Components
• General problem
• Language-
independent
Implementation
Pattern
• Defines source
artefacts
• Language-specific
• Framework-specific
• Application-specific
• Implementation
guidelines
Source code
• Executable
High Abstraction Zero Abstraction
@gfraiteur
Example: Observer Pattern
1. Vanilla Design Pattern (GoF)
@gfraiteur
Example: Observer Pattern
1
2
3 Call OnPropertyChanged whenever a property has changed.
2. Language-Specific Pattern (C#)
@gfraiteur
• Analyze property-field
dependencies
• Modify all non-const
methods
• Whenever a relevant
field has changed
• When invariants are
valid (after all changes
in the object have been
done)
Example: Observer Pattern
When? How?
3. Application-Specific Pattern (C#)
@gfraiteur
Example: Observer Pattern
4. Source code
@gfraiteur
NotifyPropertyChanged
with PostSharp
LAB 2
@gfraiteur
1. A history of programming languages and patterns
2. Defining Design Pattern Automation
3. Pattern-Oriented Software Development
4.Tools for Design Pattern
Automation
5. Agile Methodologies and Patterns
6. A last example
7. Q&A
8. Summary
Section
@gfraiteur
Transformation
Verification
@gfraiteur
Pattern
Automation
Technologies
Pattern
Automation
@gfraiteur
Example:
Richman’s Singleton
• Static validation rules:
• A single constructor
• Constructor never called
• Code transformation:
• Introduce static field
• Introduce static method GetInstance
• Make constructor private
@gfraiteur
[Nemerle.MacroUsage (Nemerle.MacroPhase.BeforeInheritance,
Nemerle.MacroTargets.Class)]
macro Singleton (t : TypeBuilder)
{
def mems = t.GetParsedMembers();
// find constructor, which we will need to call to create instance
def ctor = mems.Filter(fun (x) {
| <[ decl: ..$_ this (..$_) $_ ]> => true
| _ => false
});
match (ctor)
{
| [ <[ decl: ..$_ this (..$parms) $_ ]> as constructor ] => {
// we must prepare expressions for invoking constructor
def invoke_parms = parms.Map(x => <[ $(x.ParsedName : name) ]>);
// first define the field, where a single instance will be stored
t.Define(<[ decl:
private static mutable instance : $(t.ParsedName : name);
]>);
@gfraiteur
// finally, define getter
t.Define (<[ decl:
public static Instance : $(t.ParsedName : name)
{
get
{
// lazy initialization in generated code
when (instance == null)
instance = $(t.ParsedName : name) (..$invoke_parms);
instance;
}
}
]>);
// make sure constructor is protected
constructor.Attributes |= NemerleAttributes.Protected;
| _ => Message.Error ("Singleton design pattern requires exactly one constru
}
}
@gfraiteur
[Singleton]
class LoadBalancer
{
// Details omitted
}
public class SingletonApp
{
public static Main() : void
{
def b1 = LoadBalancer.Instance;
def b2 = LoadBalancer.Instance;
// Same instance?
when ((b1 : object == b2) && (b2 : object == b3) && (b3 : object == b4))
Console.WriteLine( "Same instance" );
// Do the load balancing
Console.WriteLine( b1.Server );
Console.WriteLine( b2.Server );
}
}
@gfraiteur
Macro-enabled .NET languages
• Nemerle
• Scala
• Boo
@gfraiteur
Poorman’s Pattern Automation:
Static Analysis
Pattern
Automation
@gfraiteur
Example:
Poorman’s Singleton
• Static validation rules:
• Static private readonly field named
‘singleton’, whose type is the current type.
• Static public method GetInstance() whose return
type is the current type, returns field ‘singleton’.
• Class constructors are private.
@gfraiteur
Singleton
with Architecture Unit Tests
LAB 3
@gfraiteur
• Limitations
• Inadequate UI and
error reporting
• Limited reflection
API
• Alternatives
• FxCop
• PostSharp
Architecture
Framework
Architecture Unit Tests
@gfraiteur
1. A history of programming languages and patterns
2. Defining Design Pattern Automation
3. Pattern-Oriented Software Development
4. Tools for Design Pattern Automation
5. Agile Methodologies
and Patterns
6. A last example
7. Q&A
8. Summary
Section
@gfraiteur
All design patterns are found in books
MYTH 5
@gfraiteur
spinning into
Emergent
Design
@gfraiteur
Quality
Eroding Design
Quality
Distance from design
@gfraiteur
Quality
Emergent Design
Quality
Knowledge
@gfraiteur
Iterative Design
• Unit Tests
• Load Tests
• Integration Tests
• Project
• Team
• Design
• Abstract
• Design
• Refactor
• Implement
• Time
• User Stories
Planning Development
TestingReview
@gfraiteur
Agile & Continuous Improvement
Design
Refactor
Implement
new stuff
Learn
Knowledge
Patterns
Language
Requirements
Code
@gfraiteur
We’re a part of a whole
Software
Engineering
Discipline
Company /
Personal
Know-How
Project
Engineering
Discipline
@gfraiteurHolašovice, Czech Republic
Patterns emerge naturally from iterative
design processes.
TRUTH 5
@gfraiteur
Example of application-specific pattern:
Business Rule Pattern
• For any class derived from BusinessRule:
• Name ends with “BusinessRule”
• No public constructor
• Has nested class named “Factory”
• Has parameterless public constructor
• Annotated with
[Export(typeof(IBusinessRuleFactory))]
@gfraiteur
1. A history of programming languages and patterns
2. Defining Design Pattern Automation
3. Pattern-Oriented Software Development
4. Tools for Design Pattern Automation
5. Agile Methodologies and Patterns
6. A last example
7. Q&A
8. Summary
Section
@gfraiteur
Example:
Reader-Writer Synchronized Object
• Code Generation
• Introduce interface IReaderWriterSynchronized
• [ReaderLock], [WriterLock] executes the method with
the right locking level
• Code Verification
• All fields must be private
• Cannot access field without proper lock
@gfraiteur
ReaderWriterSynchronized
with PostSharp
LAB 4
@gfraiteur
Q&A
Gael Fraiteur
gael@postsharp.net
@gfraiteur
@gfraiteurCopyright © by Arild Vågen
Summary
• Compilers must do more to raise abstraction level
• Patterns stem from continuous improvement
BETTER SOFTWARE THROUGH SIMPLER CODE

More Related Content

What's hot

Annotations in PHP, They Exist.
Annotations in PHP, They Exist.Annotations in PHP, They Exist.
Annotations in PHP, They Exist.Rafael Dohms
 
PHP Annotations: They exist! - JetBrains Webinar
 PHP Annotations: They exist! - JetBrains Webinar PHP Annotations: They exist! - JetBrains Webinar
PHP Annotations: They exist! - JetBrains WebinarRafael Dohms
 
(4) c sharp introduction_object_orientation_part_i
(4) c sharp introduction_object_orientation_part_i(4) c sharp introduction_object_orientation_part_i
(4) c sharp introduction_object_orientation_part_iNico Ludwig
 
Model-Driven Engineering: a bottom-up approach based on meta-programming (ELA...
Model-Driven Engineering: a bottom-up approach based on meta-programming (ELA...Model-Driven Engineering: a bottom-up approach based on meta-programming (ELA...
Model-Driven Engineering: a bottom-up approach based on meta-programming (ELA...Jean-Michel Bruel
 
Executable specifications for xtext
Executable specifications for xtextExecutable specifications for xtext
Executable specifications for xtextmeysholdt
 
The Ring programming language version 1.6 book - Part 181 of 189
The Ring programming language version 1.6 book - Part 181 of 189The Ring programming language version 1.6 book - Part 181 of 189
The Ring programming language version 1.6 book - Part 181 of 189Mahmoud Samir Fayed
 
New c sharp3_features_(linq)_part_iv
New c sharp3_features_(linq)_part_ivNew c sharp3_features_(linq)_part_iv
New c sharp3_features_(linq)_part_ivNico Ludwig
 

What's hot (11)

Annotations in PHP, They Exist.
Annotations in PHP, They Exist.Annotations in PHP, They Exist.
Annotations in PHP, They Exist.
 
F# and the DLR
F# and the DLRF# and the DLR
F# and the DLR
 
F# for Scala developers
F# for Scala developersF# for Scala developers
F# for Scala developers
 
PHP Annotations: They exist! - JetBrains Webinar
 PHP Annotations: They exist! - JetBrains Webinar PHP Annotations: They exist! - JetBrains Webinar
PHP Annotations: They exist! - JetBrains Webinar
 
(4) c sharp introduction_object_orientation_part_i
(4) c sharp introduction_object_orientation_part_i(4) c sharp introduction_object_orientation_part_i
(4) c sharp introduction_object_orientation_part_i
 
Model-Driven Engineering: a bottom-up approach based on meta-programming (ELA...
Model-Driven Engineering: a bottom-up approach based on meta-programming (ELA...Model-Driven Engineering: a bottom-up approach based on meta-programming (ELA...
Model-Driven Engineering: a bottom-up approach based on meta-programming (ELA...
 
Presentation
PresentationPresentation
Presentation
 
Executable specifications for xtext
Executable specifications for xtextExecutable specifications for xtext
Executable specifications for xtext
 
The Ring programming language version 1.6 book - Part 181 of 189
The Ring programming language version 1.6 book - Part 181 of 189The Ring programming language version 1.6 book - Part 181 of 189
The Ring programming language version 1.6 book - Part 181 of 189
 
Coding standard
Coding standardCoding standard
Coding standard
 
New c sharp3_features_(linq)_part_iv
New c sharp3_features_(linq)_part_ivNew c sharp3_features_(linq)_part_iv
New c sharp3_features_(linq)_part_iv
 

Viewers also liked

Functional Leap of Faith (Keynote at JDay Lviv 2014)
Functional Leap of Faith (Keynote at JDay Lviv 2014)Functional Leap of Faith (Keynote at JDay Lviv 2014)
Functional Leap of Faith (Keynote at JDay Lviv 2014)Tomer Gabel
 
Maglev-A different way to develop with Ruby
Maglev-A different way to develop with RubyMaglev-A different way to develop with Ruby
Maglev-A different way to develop with RubyHernan Wilkinson
 
Avoiding to Reinvent the flat tire
Avoiding to Reinvent the flat tireAvoiding to Reinvent the flat tire
Avoiding to Reinvent the flat tireHernan Wilkinson
 
Design Pattern From Java To Ruby
Design Pattern    From Java To RubyDesign Pattern    From Java To Ruby
Design Pattern From Java To RubyRobbin Fan
 
History of computer language
History of computer languageHistory of computer language
History of computer languageClaire Punkcor
 

Viewers also liked (7)

Bab satu
Bab satuBab satu
Bab satu
 
Functional Leap of Faith (Keynote at JDay Lviv 2014)
Functional Leap of Faith (Keynote at JDay Lviv 2014)Functional Leap of Faith (Keynote at JDay Lviv 2014)
Functional Leap of Faith (Keynote at JDay Lviv 2014)
 
Chapter 4 computer language
Chapter 4 computer languageChapter 4 computer language
Chapter 4 computer language
 
Maglev-A different way to develop with Ruby
Maglev-A different way to develop with RubyMaglev-A different way to develop with Ruby
Maglev-A different way to develop with Ruby
 
Avoiding to Reinvent the flat tire
Avoiding to Reinvent the flat tireAvoiding to Reinvent the flat tire
Avoiding to Reinvent the flat tire
 
Design Pattern From Java To Ruby
Design Pattern    From Java To RubyDesign Pattern    From Java To Ruby
Design Pattern From Java To Ruby
 
History of computer language
History of computer languageHistory of computer language
History of computer language
 

Similar to Design Pattern Automation

Software Engineering Best Practices @ Nylas
Software Engineering Best Practices @ NylasSoftware Engineering Best Practices @ Nylas
Software Engineering Best Practices @ NylasBen Gotow
 
Introduction to Design Patterns in Javascript
Introduction to Design Patterns in JavascriptIntroduction to Design Patterns in Javascript
Introduction to Design Patterns in JavascriptSanthosh Kumar Srinivasan
 
Guide to Destroying Codebases The Demise of Clever Code
Guide to Destroying Codebases   The Demise of Clever CodeGuide to Destroying Codebases   The Demise of Clever Code
Guide to Destroying Codebases The Demise of Clever CodeGabor Varadi
 
TypeScript . the JavaScript developer best friend!
TypeScript . the JavaScript developer best friend!TypeScript . the JavaScript developer best friend!
TypeScript . the JavaScript developer best friend!Alessandro Giorgetti
 
DSL's with Groovy
DSL's with GroovyDSL's with Groovy
DSL's with Groovypaulbowler
 
Style & Design Principles 02 - Design Patterns
Style & Design Principles 02 - Design PatternsStyle & Design Principles 02 - Design Patterns
Style & Design Principles 02 - Design PatternsNick Pruehs
 
cf.Objective() 2017 - Design patterns - Brad Wood
cf.Objective() 2017 - Design patterns - Brad Woodcf.Objective() 2017 - Design patterns - Brad Wood
cf.Objective() 2017 - Design patterns - Brad WoodOrtus Solutions, Corp
 
Online TechTalk  "Patterns in Embedded SW Design"
Online TechTalk  "Patterns in Embedded SW Design"Online TechTalk  "Patterns in Embedded SW Design"
Online TechTalk  "Patterns in Embedded SW Design"GlobalLogic Ukraine
 
Going to Mars with Groovy Domain-Specific Languages
Going to Mars with Groovy Domain-Specific LanguagesGoing to Mars with Groovy Domain-Specific Languages
Going to Mars with Groovy Domain-Specific LanguagesGuillaume Laforge
 
Design pattern
Design patternDesign pattern
Design patternOmar Isaid
 
Data Science Accelerator Program
Data Science Accelerator ProgramData Science Accelerator Program
Data Science Accelerator ProgramGoDataDriven
 
How I Learned to Stop Worrying and Love Legacy Code - Ox:Agile 2018
How I Learned to Stop Worrying and Love Legacy Code - Ox:Agile 2018How I Learned to Stop Worrying and Love Legacy Code - Ox:Agile 2018
How I Learned to Stop Worrying and Love Legacy Code - Ox:Agile 2018Mike Harris
 
Software design and Architecture.pptx
Software design and Architecture.pptxSoftware design and Architecture.pptx
Software design and Architecture.pptxSHAHZAIBABBAS13
 
10 Ways To Improve Your Code( Neal Ford)
10  Ways To  Improve  Your  Code( Neal  Ford)10  Ways To  Improve  Your  Code( Neal  Ford)
10 Ways To Improve Your Code( Neal Ford)guestebde
 
Style & Design Principles 01 - Code Style & Structure
Style & Design Principles 01 - Code Style & StructureStyle & Design Principles 01 - Code Style & Structure
Style & Design Principles 01 - Code Style & StructureNick Pruehs
 

Similar to Design Pattern Automation (20)

Multithreading Design Patterns
Multithreading Design PatternsMultithreading Design Patterns
Multithreading Design Patterns
 
Software Engineering Best Practices @ Nylas
Software Engineering Best Practices @ NylasSoftware Engineering Best Practices @ Nylas
Software Engineering Best Practices @ Nylas
 
Js tips & tricks
Js tips & tricksJs tips & tricks
Js tips & tricks
 
Introduction to Design Patterns in Javascript
Introduction to Design Patterns in JavascriptIntroduction to Design Patterns in Javascript
Introduction to Design Patterns in Javascript
 
Guide to Destroying Codebases The Demise of Clever Code
Guide to Destroying Codebases   The Demise of Clever CodeGuide to Destroying Codebases   The Demise of Clever Code
Guide to Destroying Codebases The Demise of Clever Code
 
10-DesignPatterns.ppt
10-DesignPatterns.ppt10-DesignPatterns.ppt
10-DesignPatterns.ppt
 
TypeScript . the JavaScript developer best friend!
TypeScript . the JavaScript developer best friend!TypeScript . the JavaScript developer best friend!
TypeScript . the JavaScript developer best friend!
 
DSL's with Groovy
DSL's with GroovyDSL's with Groovy
DSL's with Groovy
 
Style & Design Principles 02 - Design Patterns
Style & Design Principles 02 - Design PatternsStyle & Design Principles 02 - Design Patterns
Style & Design Principles 02 - Design Patterns
 
cf.Objective() 2017 - Design patterns - Brad Wood
cf.Objective() 2017 - Design patterns - Brad Woodcf.Objective() 2017 - Design patterns - Brad Wood
cf.Objective() 2017 - Design patterns - Brad Wood
 
Online TechTalk  "Patterns in Embedded SW Design"
Online TechTalk  "Patterns in Embedded SW Design"Online TechTalk  "Patterns in Embedded SW Design"
Online TechTalk  "Patterns in Embedded SW Design"
 
10 Ways To Improve Your Code
10 Ways To Improve Your Code10 Ways To Improve Your Code
10 Ways To Improve Your Code
 
Going to Mars with Groovy Domain-Specific Languages
Going to Mars with Groovy Domain-Specific LanguagesGoing to Mars with Groovy Domain-Specific Languages
Going to Mars with Groovy Domain-Specific Languages
 
Design pattern
Design patternDesign pattern
Design pattern
 
Data Science Accelerator Program
Data Science Accelerator ProgramData Science Accelerator Program
Data Science Accelerator Program
 
Design Patterns
Design PatternsDesign Patterns
Design Patterns
 
How I Learned to Stop Worrying and Love Legacy Code - Ox:Agile 2018
How I Learned to Stop Worrying and Love Legacy Code - Ox:Agile 2018How I Learned to Stop Worrying and Love Legacy Code - Ox:Agile 2018
How I Learned to Stop Worrying and Love Legacy Code - Ox:Agile 2018
 
Software design and Architecture.pptx
Software design and Architecture.pptxSoftware design and Architecture.pptx
Software design and Architecture.pptx
 
10 Ways To Improve Your Code( Neal Ford)
10  Ways To  Improve  Your  Code( Neal  Ford)10  Ways To  Improve  Your  Code( Neal  Ford)
10 Ways To Improve Your Code( Neal Ford)
 
Style & Design Principles 01 - Code Style & Structure
Style & Design Principles 01 - Code Style & StructureStyle & Design Principles 01 - Code Style & Structure
Style & Design Principles 01 - Code Style & Structure
 

More from PostSharp Technologies

Advanced Defensive Coding Techniques (with Introduction to Design by Contract)
Advanced Defensive Coding Techniques (with Introduction to Design by Contract)Advanced Defensive Coding Techniques (with Introduction to Design by Contract)
Advanced Defensive Coding Techniques (with Introduction to Design by Contract)PostSharp Technologies
 
Applying Object Composition to Build Rich Domain Models
Applying Object Composition to Build Rich Domain ModelsApplying Object Composition to Build Rich Domain Models
Applying Object Composition to Build Rich Domain ModelsPostSharp Technologies
 
Building Better Architecture with UX-Driven Design
Building Better Architecture with UX-Driven DesignBuilding Better Architecture with UX-Driven Design
Building Better Architecture with UX-Driven DesignPostSharp Technologies
 
Solving Localization Challenges with Design Pattern Automation
Solving Localization Challenges with Design Pattern AutomationSolving Localization Challenges with Design Pattern Automation
Solving Localization Challenges with Design Pattern AutomationPostSharp Technologies
 
Applying a Methodical Approach to Website Performance
Applying a Methodical Approach to Website PerformanceApplying a Methodical Approach to Website Performance
Applying a Methodical Approach to Website PerformancePostSharp Technologies
 
10 Reasons You MUST Consider Pattern-Aware Programming
10 Reasons You MUST Consider Pattern-Aware Programming10 Reasons You MUST Consider Pattern-Aware Programming
10 Reasons You MUST Consider Pattern-Aware ProgrammingPostSharp Technologies
 
Produce Cleaner Code with Aspect-Oriented Programming
Produce Cleaner Code with Aspect-Oriented ProgrammingProduce Cleaner Code with Aspect-Oriented Programming
Produce Cleaner Code with Aspect-Oriented ProgrammingPostSharp Technologies
 

More from PostSharp Technologies (9)

Advanced Defensive Coding Techniques (with Introduction to Design by Contract)
Advanced Defensive Coding Techniques (with Introduction to Design by Contract)Advanced Defensive Coding Techniques (with Introduction to Design by Contract)
Advanced Defensive Coding Techniques (with Introduction to Design by Contract)
 
Applying Object Composition to Build Rich Domain Models
Applying Object Composition to Build Rich Domain ModelsApplying Object Composition to Build Rich Domain Models
Applying Object Composition to Build Rich Domain Models
 
Performance is a Feature!
Performance is a Feature!Performance is a Feature!
Performance is a Feature!
 
Building Better Architecture with UX-Driven Design
Building Better Architecture with UX-Driven DesignBuilding Better Architecture with UX-Driven Design
Building Better Architecture with UX-Driven Design
 
Solving Localization Challenges with Design Pattern Automation
Solving Localization Challenges with Design Pattern AutomationSolving Localization Challenges with Design Pattern Automation
Solving Localization Challenges with Design Pattern Automation
 
Applying a Methodical Approach to Website Performance
Applying a Methodical Approach to Website PerformanceApplying a Methodical Approach to Website Performance
Applying a Methodical Approach to Website Performance
 
10 Reasons You MUST Consider Pattern-Aware Programming
10 Reasons You MUST Consider Pattern-Aware Programming10 Reasons You MUST Consider Pattern-Aware Programming
10 Reasons You MUST Consider Pattern-Aware Programming
 
Multithreading Fundamentals
Multithreading FundamentalsMultithreading Fundamentals
Multithreading Fundamentals
 
Produce Cleaner Code with Aspect-Oriented Programming
Produce Cleaner Code with Aspect-Oriented ProgrammingProduce Cleaner Code with Aspect-Oriented Programming
Produce Cleaner Code with Aspect-Oriented Programming
 

Recently uploaded

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
 
"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
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????blackmambaettijean
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: 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
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
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
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
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
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
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
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
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
 

Recently uploaded (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
 
"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
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: 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.
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
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
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
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
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
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
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
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
 

Design Pattern Automation

Editor's Notes

  1. First I would like to thank you all for being present here today. I appreciate the time you are spending here. Imagine the total opportunity cost of this couple of hours we will be spending here together – if we all billed our standard rate. Obviously, I would like to serve you during that time. And I don’t only want to serve you, but the larger community too. Today, I would like to serve by planting a seed. An idea that can grow or perish, depending on you. But if we allow the seed to grow, together, we are going to improve the software development industry. We are going to make it easier to build good software. Make it easier to build good software. This idea is to change the way we think about design patterns.
  2. Good morning! My name is Gael Fraiteur. You may think I have a weird accent and even think I am French, but actually I was grown in Belgium and have lived in Czech Republic for the last 12 years.(it’s wonderful being here in the US. Appreciate you take time outside of working hours to improve your skills and the profession. Not everybody does that and there’re many(?) here in the US. I’ll like to thank you guys for being what you are and doing what you do).When I was 15, that was 20 years ago, my English teacher came to me and asked whether I would be skilled enough to manage students’ test results and generate school reports. I said yes, although today I know I was not, and spent the largest part of the summer coding a client-server application in PowerBuilder – an amazing development environment. I have been coding for 4 years at that time, several hours per day, but my previous programs were mere “hacking”. So from a technical point of view, I was prepared. What was really new for me was to build a technology for real users, not for IT specialists. My first version was basically a set of table editors based on the relational database model. With time, I understood that the user interface of a technology should be as close as possible to the way users think and work, and not close to the platform it is built on (a relational database).Nine years ago I started another project: PostSharp. It was a small aspect-oriented framework for Microsoft .NET. It was not the first AOP framework, but I was very fortunate that the community let the seed grow and it became the most popular. The reason of this success, I think, is that I applied the lesson learned years before: the user interface of a technology should be as close as possible to the way users think and work. But this time, the user interface was PostSharp’s public API.The same principle applies to the design of programming languages. And I believe that today, if we want to get programming languages closer to the way human think, we need to look in the direction of patterns. I would like to communicate this vision to you in this talk.
  3. Three years ago, PostSharp outgrew my capacity to maintain it as a free open-source project and, out of necessity, became a commercial product. In an industry dominated by open source and big platform vendors, to make a living from development tools is extraordinarily difficult. We at PostSharp Technologies have been fortunate enough to succeed in this endeavor. We are grateful for the trust we receive from our customers – from the one-man shop to the largest corporations.This remark should also serve as a disclaimer that this talk shall undoubted be biased by my very source of revenues.However, my commitment to you in this talk is to share the vision which motivates us day after day. This vision is much larger than our product itself, and you can implement it with other tools, perhaps less appropriate – and, hopefully we will be able to spark an idea that will influence the design of future language and compilers.
  4. Programming for the UNIVAC FAC-TRONIC system, 1935 by Remington Rand inchttp://bitsavers.informatik.uni-stuttgart.de/pdf/univac/univac1/UNIVAC_Programming_Jan53.pdf
  5. http://en.wikipedia.org/wiki/File:FortranCardPROJ039.agr.jpg
  6. LISP 1.5 Programmer’s Manual
  7. LISP 1.5 Programmer’s Manual
  8. http://www.flickr.com/photos/62405357@N03/8519808328To bridge the gap between the way human think and how machine work.Both humans and machines have limitations.At the beginning there was assembly language and punch cards, then symbolic memory and procedural languages.
  9. In his book “the timeless way of building”, Christopher Alexander asks the question:How is it possible that any simple farmer could make a house, a thousand times more beautiful than all the struggling architects of the last fifty years could do?Answer:Shared knowledge, and the knowledge was in the languageIncremental process, centuries of experienceVernacular architecture (folk architecture)http://whc.unesco.org/en/list/861http://www.holasovice.eu/fotogalerie-1/holasovice/
  10. What is a pattern?RepetitionResolution of forcesSelf-sustainingCommonality / variability -&gt; All humans are equal but some are more equal than othershttp://www.flickr.com/photos/docman/1516309490http://en.wikipedia.org/wiki/Pando_(tree)Pando (Latin for &quot;I spread&quot;), also known as The Trembling Giant,[1][2] is a clonal colony of a single male quaking aspen (Populustremuloides) determined to be a single living organism by identical genetic markers[3] and one massive underground root system. The plant is estimated to weigh collectively 6,000,000 kg (6,600 short tons),[4] making it the heaviest known organism.[5] The root system of Pando, at an estimated 80,000 years old, is among the oldest known living organisms.[6]Pando is located in the Fishlake National Forest, near Fish Lake at the western edge of the Colorado Plateau in South-central Utah.
  11. http://www.flickr.com/photos/stijnnieuwendijk/3098445189
  12. http://www.basiccarpentrytechniques.com/Carpentry%20for%20Boys/Carpentry%20For%20Boys1.htmlCARPENTRY FOR BOYSWITH 250 ORIGINAL ILLUSTRATIONSBy J. S. ZERBE, M.E.Copyright, 1914, byTHE NEW YORK BOOK COMPANY
  13. There are still some patterns in objects that we are not able to represent in a programming language
  14. http://www.flickr.com/photos/abstractstv/4358678510
  15. http://www.flickr.com/photos/drewmaughan/7122608959
  16. Before as after the industrial revolution, talent is the rare commodity. We want talented people to have a maximal output.The industrial revolution is not just about technology, this is also a revolution in social organization, through division of labor, specialization of professions, specialized schools, … There are no fewer skills involved in industrial shoes production – there are actually much more. But the production process makes better use of these skills.
  17. Better technology triggers better output per worker.Our parentsWhat is going to be the contribution of our generation to the software industry? How is it going to become more of an industry and less of an art, to achieve the same productivity enhancements that are required to meet increasing demand?&apos;Increase the speed of agricultural mechanisation, to struggle for the modernization of agriculture. Printno. 8027.6288.
  18. http://www.flickr.com/photos/abstractstv/4358678510Abstract means much variability and little commonality
  19. http://en.wikipedia.org/wiki/Observer_pattern
  20. http://www.flickr.com/photos/liz/8712469709Caïn by Henri Vidal, Tuileries Garden, Paris, 1896
  21. http://nemerle.org/wiki/index.php?title=Design_patterns
  22. http://www.flickr.com/photos/abstractstv/4358678510Abstract means much variability and little commonality
  23. Knowledge increases. With continuous refactoring, a better design is emerging.
  24. Knowledge increases. With continuous refactoring, a better design is emerging.
  25. http://www.jasonmundok.com/wp-content/uploads/2012/02/Agile-Iteration-Diagram.jpg
  26. As a result of the iterative development process, you are already creating reusable designs = design patterns
  27. In his book “the timeless way of building”, Christopher Alexander asks the question:Why was an 19th century farmer, without formal education, able to build a house a thousand times more beautiful that anything that was build in the 20th century by formally-educated architects? Where people lived happier?Answer:Shared knowledge, and the knowledge was in the languageIncremental process, centuries of experienceVernacular architecture (folk architecture)TODO: Add a quote from Alexanderhttp://whc.unesco.org/en/list/861http://www.holasovice.eu/fotogalerie-1/holasovice/
  28. I believe that it should become fundamentally easier to write good software.Look at the way we work today. We are working at a ridiculously low level of abstraction. We are implementing change notification and change tracking manually, are struggling with locks to cope with multithreading, relying on code reviews to ensure design compliance. Programming is so complex that companies can’t find enough qualified people to make it. Underqualified people write crap and there seems nothing to do about that.Our society runs on software. Our daily life is ruled by hundreds of millions of lines of code, from our mobile devices to transportation to tax collection. How do we build increasingly complex systems if the technology itself does not make it increasingly simpler? I believe that programming languages should make it fundamentally easier to write good software.And I think we should look in the direction of patterns. Patterns are fundamental to the way humans think. We learn pattern recognition is the first months of our existence. Patterns are intrinsic to the very way we perceive the nature. Regularity and variety only make sense if we have this notion of patterns. Patterns, concepts, objects, are same thing. Object orientation was a first step to make programming language closer to the structure of human cognition. But why stopping there? We need programming languages that are able to represent more complex patterns than what we now say “objects”.There are two principal ideas in this talk. The first idea is that the implementation of design patterns can be automated, and actually is already being automated, if we look at some features of the C# language. Working with design patterns means that the source code is built against a model that is of higher abstraction than the machine on which it runs. Smarter compilers can validate the source code against this model and generate instructions to map higher abstraction to lower abstraction. The second idea is that design patterns don’t live in books but in software, and that discovering and designing good patterns is a natural part of an agile development process -- because to learn is to identify patterns. So, there is a great chain of being, where the industry benefits individual projects and projects contribute back to the industry.With PostSharp, we are proud to contribute to this effort.Thank you.