SlideShare uma empresa Scribd logo
1 de 113
Baixar para ler offline
simplicity 0.3
Osvaldas Grigas
o.grigas@gmail.com
complexity 0.3
Osvaldas Grigas
o.grigas@gmail.com
inspired by
Dan
North
Rich
Hickey
J.B.
Rainsberger
Michael
Feathers
Edsger Dijkstra
(1980)
Computing's central challenge,
"How not to make a mess of it",
has not been met.
agile
agile
continuous improvement
based on frequent feedback
iterative development
incremental development
DONE
embrace the transient nature
of your code
Russ Miles
Complexity is the silent killer of
delivering change at the right time.
simplicity is prerequisite for agility
what is simplicity ?
Nothing is more simple
than a single giant button
MacBook Wheel
what "simple" isn’t ...
what "simple" isn’t ...
familiar / convenient
what "simple" isn’t ...
familiar / convenient
small / concise
what "simple" isn’t ...
familiar / convenient
small / concise
beautiful / elegant
“Simplicity -- the art of maximizing the
amount of work not done -- is essential.”
from the agile principles
YAGNI
from the agile principles
“Simplicity -- the art of maximizing the
amount of work not done -- is essential.”
“Technical excellence and
good design enhances agility.”
from the agile principles
Martin Fowler
Design is there to enable you to
keep changing the software easily.
when it comes to design ...
COMPLEXITY SUCKS
SIMPLICITY RULES
COMPLEXITY SUCKS ...
COMPLEXITY SUCKS ...
… your brain power
COMPLEXITY SUCKS ...
… your brain power
Rich Hickey
Once your software is of a
certain size, complexity is gonna
dominate what you can do.
essential
complexity
essential
complexity
your code
essential
complexity
your codelibraries
frameworks
essential
complexity
language
runtime
your codelibraries
frameworks
accidental
complexity
essential
complexity
SIMPLICITY RULES ...
SIMPLICITY RULES ...
… are …
SIMPLICITY RULES ...
… are …
The 4 Rules of Simple Design
SIMPLICITY RULES ...
… are …
The 4 Rules of Simple Design
1) passes all tests
SIMPLICITY RULES ...
… are …
The 4 Rules of Simple Design
1) passes all tests
2) clear, expressive names
SIMPLICITY RULES ...
… are …
The 4 Rules of Simple Design
1) passes all tests
2) clear, expressive names
3) no duplication
SIMPLICITY RULES ...
… are …
The 4 Rules of Simple Design
1) passes all tests
2) clear, expressive names
3) no duplication
4) minimal
rule #4: minimal
the less code,
the better
code folding
code
generators
dependency
managers
stop typing.
think!
test-first
(TDD / BDD)
rule #3: no duplication
primitive obsession
duplication in behavior
data clump
duplication in structure
refactoring
rule #2: clear, expressive names
small, focused methods
reduce cyclomatic complexity
small, focused classes
single responsibility
AccountService
AccountManager
AccountHandler
AccountUtils
AccountHelper
AccountImpl
AccountData
AccountDTO
AccountInfo
AccountDetails
AccountObject
AbstractAccount
BaseAccount
CustomAccount
SimpleAccount
refactoring
rule #1: passes all tests
unit testing
testability & good design
testability & good design
(but not integration tests)
inheritance-based design
wget -qO- http://c2.com/ | tr -cs '[:alpha:]' 'n' | sort | uniq
composition
dependencies
auto-import
refactoring
tools
A
G
F
D
C
introduce indirection
A
B
E G
F
D
C
introduce indirection
A
B
E G
F
D
C
follow
the law of Demeter
introduce indirection
modularity
coupling
add an interface?
layered architectures
add remoting?
SOAP
enterprise grade decoupling?
ESB
enterprise grade decoupling?
ESB
assumptions
assumptions
interface segregation
tell, don’t ask
high cohesion
dependency inversion
role
anti-corruption layer
adapter
role
notify
Payment
Order
Auditor
Financial
Event
Listener
Mongo
Audit
Trail
log
Audit
Trail
Mongo
Audit
Records
insert
Payment
Order
Audit
DAO
Audit
DAO
Impl
insert
further decoupling
queue
publish subscribe
use cases
& business rules
framework
persistence
framework
web
DB
infrastructure
messaging
QUEUE
task
scheduler
WS
Domain
Logic
Framework
Framework
Domain
Logic
Domain
Logic
Framework
Framework
accidental
complexity
complexity
leak
@Entity
@Table(name = "orders", schema = "com"})
public class Order implements Serializable {
@Id
@GeneratedValue(strategy = SEQUENCE, generator = "order_seq")
@Column(name = "ID", unique = true, nullable = false)
private Integer id;
@Column(name = "NUMBER", nullable = false, length = 8)
private String number;
@ManyToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
@JoinTable(name = "order_items", catalog = "com",
joinColumns = {@JoinColumn(name = "ORDER_ID",
updatable = false, nullable = false)},
inverseJoinColumns = {@JoinColumn(name = "ITEM_ID",
updatable = false, nullable = false)})
private Set<Item> items = new HashSet<Item>();
}
the law of leaky abstractions
home-grown
frameworks
libraries
state
& side effects
values
& pure functions
functional style imperative style
functional style
expressions
imperative style
statements
functional style
expressions
immutable values
imperative style
statements
mutable state
functional style
expressions
immutable values
data transformations
imperative style
statements
mutable state
side effects
functional style
expressions
immutable values
data transformations
recursion &
polymorphism
imperative style
statements
mutable state
side effects
looping &
branching
stepping out of
comfort zone
Edsger Dijkstra
(1980)
Computing's central challenge,
"How not to make a mess of it",
has not been met.
I‘m
done

Mais conteúdo relacionado

Semelhante a Simplicity

Clean Code - Writing code for human
Clean Code - Writing code for humanClean Code - Writing code for human
Clean Code - Writing code for humanNETKO Solution
 
Managing Complexity in Salesforce, David Felkel
Managing Complexity in Salesforce, David FelkelManaging Complexity in Salesforce, David Felkel
Managing Complexity in Salesforce, David FelkelCzechDreamin
 
Growing Software and Growing Ourselves
Growing Software and Growing OurselvesGrowing Software and Growing Ourselves
Growing Software and Growing OurselvesDaniel Parkin
 
Quick & Easy SQL Tips
Quick & Easy SQL TipsQuick & Easy SQL Tips
Quick & Easy SQL TipsIke Ellis
 
The View - The top 30 Development tips
The View - The top 30 Development tipsThe View - The top 30 Development tips
The View - The top 30 Development tipsBill Buchan
 
Agile Development Overview (with a bit about builds)
Agile Development Overview (with a bit about builds)Agile Development Overview (with a bit about builds)
Agile Development Overview (with a bit about builds)David Benjamin
 
Quick & Easy SQL Tips
Quick & Easy SQL TipsQuick & Easy SQL Tips
Quick & Easy SQL TipsIke Ellis
 
Sea spin5 2013-notes
Sea spin5 2013-notesSea spin5 2013-notes
Sea spin5 2013-notesJeff Smith
 
Software design - Write solid software with the ideal chalk
Software design - Write solid software with the  ideal chalkSoftware design - Write solid software with the  ideal chalk
Software design - Write solid software with the ideal chalkAlejandro Claro Mosqueda
 
Dev buchan 30 proven tips
Dev buchan 30 proven tipsDev buchan 30 proven tips
Dev buchan 30 proven tipsBill Buchan
 
Simplicty Appreciation 101
Simplicty Appreciation 101Simplicty Appreciation 101
Simplicty Appreciation 101Craig Jones
 
Essential Complexity in Systems Architecture
Essential Complexity in Systems ArchitectureEssential Complexity in Systems Architecture
Essential Complexity in Systems ArchitectureMark Mishaev
 
Excavating the knowledge of our ancestors
Excavating the knowledge of our ancestorsExcavating the knowledge of our ancestors
Excavating the knowledge of our ancestorsUwe Friedrichsen
 
Concepts of Clean Code adapted for JavaScript - Tech'n'Drinks @myposter
Concepts of Clean Code adapted for JavaScript - Tech'n'Drinks @myposterConcepts of Clean Code adapted for JavaScript - Tech'n'Drinks @myposter
Concepts of Clean Code adapted for JavaScript - Tech'n'Drinks @mypostermyposter GmbH
 
How to Achieve Scale with MongoDB
How to Achieve Scale with MongoDBHow to Achieve Scale with MongoDB
How to Achieve Scale with MongoDBMongoDB
 
YAGNI Principle and Clean Code
YAGNI Principle and Clean CodeYAGNI Principle and Clean Code
YAGNI Principle and Clean CodeLuan Reffatti
 
Don't let your tests slow you down
Don't let your tests slow you downDon't let your tests slow you down
Don't let your tests slow you downDaniel Irvine
 
Code Excellence for the Average Programmer
Code Excellence for the Average ProgrammerCode Excellence for the Average Programmer
Code Excellence for the Average ProgrammerLlewellyn Falco
 
Clean code & design patterns
Clean code & design patternsClean code & design patterns
Clean code & design patternsPascal Larocque
 

Semelhante a Simplicity (20)

CQRS recepies
CQRS recepiesCQRS recepies
CQRS recepies
 
Clean Code - Writing code for human
Clean Code - Writing code for humanClean Code - Writing code for human
Clean Code - Writing code for human
 
Managing Complexity in Salesforce, David Felkel
Managing Complexity in Salesforce, David FelkelManaging Complexity in Salesforce, David Felkel
Managing Complexity in Salesforce, David Felkel
 
Growing Software and Growing Ourselves
Growing Software and Growing OurselvesGrowing Software and Growing Ourselves
Growing Software and Growing Ourselves
 
Quick & Easy SQL Tips
Quick & Easy SQL TipsQuick & Easy SQL Tips
Quick & Easy SQL Tips
 
The View - The top 30 Development tips
The View - The top 30 Development tipsThe View - The top 30 Development tips
The View - The top 30 Development tips
 
Agile Development Overview (with a bit about builds)
Agile Development Overview (with a bit about builds)Agile Development Overview (with a bit about builds)
Agile Development Overview (with a bit about builds)
 
Quick & Easy SQL Tips
Quick & Easy SQL TipsQuick & Easy SQL Tips
Quick & Easy SQL Tips
 
Sea spin5 2013-notes
Sea spin5 2013-notesSea spin5 2013-notes
Sea spin5 2013-notes
 
Software design - Write solid software with the ideal chalk
Software design - Write solid software with the  ideal chalkSoftware design - Write solid software with the  ideal chalk
Software design - Write solid software with the ideal chalk
 
Dev buchan 30 proven tips
Dev buchan 30 proven tipsDev buchan 30 proven tips
Dev buchan 30 proven tips
 
Simplicty Appreciation 101
Simplicty Appreciation 101Simplicty Appreciation 101
Simplicty Appreciation 101
 
Essential Complexity in Systems Architecture
Essential Complexity in Systems ArchitectureEssential Complexity in Systems Architecture
Essential Complexity in Systems Architecture
 
Excavating the knowledge of our ancestors
Excavating the knowledge of our ancestorsExcavating the knowledge of our ancestors
Excavating the knowledge of our ancestors
 
Concepts of Clean Code adapted for JavaScript - Tech'n'Drinks @myposter
Concepts of Clean Code adapted for JavaScript - Tech'n'Drinks @myposterConcepts of Clean Code adapted for JavaScript - Tech'n'Drinks @myposter
Concepts of Clean Code adapted for JavaScript - Tech'n'Drinks @myposter
 
How to Achieve Scale with MongoDB
How to Achieve Scale with MongoDBHow to Achieve Scale with MongoDB
How to Achieve Scale with MongoDB
 
YAGNI Principle and Clean Code
YAGNI Principle and Clean CodeYAGNI Principle and Clean Code
YAGNI Principle and Clean Code
 
Don't let your tests slow you down
Don't let your tests slow you downDon't let your tests slow you down
Don't let your tests slow you down
 
Code Excellence for the Average Programmer
Code Excellence for the Average ProgrammerCode Excellence for the Average Programmer
Code Excellence for the Average Programmer
 
Clean code & design patterns
Clean code & design patternsClean code & design patterns
Clean code & design patterns
 

Último

%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfonteinmasabamasaba
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension AidPhilip Schwarz
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionOnePlan Solutions
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...masabamasaba
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is insideshinachiaurasa2
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024VictoriaMetrics
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...masabamasaba
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...Jittipong Loespradit
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnAmarnathKambale
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesVictorSzoltysek
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdfPearlKirahMaeRagusta1
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in sowetomasabamasaba
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfkalichargn70th171
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfonteinmasabamasaba
 

Último (20)

%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 

Simplicity