Your SlideShare is downloading. ×
Simplicity
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Saving this for later?

Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime - even offline.

Text the download link to your phone

Standard text messaging rates apply

Simplicity

126
views

Published on

Building working software is hard. But it's so much harder to build software that is easy to change. Yet this is a prerequisite for being truly agile, and a key enabler of agility is simplicity. But …

Building working software is hard. But it's so much harder to build software that is easy to change. Yet this is a prerequisite for being truly agile, and a key enabler of agility is simplicity. But what exactly does simplicity mean and why is it so hard to achieve? It looks like complexity creeps in as soon as you stop paying attention, and most of it is accidental. Luckily, there are practical ways to get to simplicity by following good design principles and choosing simpler tools.

Published in: Software

0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
126
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
7
Comments
0
Likes
1
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. simplicity 0.3 Osvaldas Grigas o.grigas@gmail.com
  • 2. complexity 0.3 Osvaldas Grigas o.grigas@gmail.com
  • 3. inspired by Dan North Rich Hickey J.B. Rainsberger Michael Feathers
  • 4. Edsger Dijkstra (1980) Computing's central challenge, "How not to make a mess of it", has not been met.
  • 5. agile
  • 6. agile continuous improvement based on frequent feedback
  • 7. iterative development
  • 8. incremental development
  • 9. DONE
  • 10. embrace the transient nature of your code
  • 11. Russ Miles Complexity is the silent killer of delivering change at the right time.
  • 12. simplicity is prerequisite for agility
  • 13. what is simplicity ?
  • 14. Nothing is more simple than a single giant button MacBook Wheel
  • 15. what "simple" isn’t ...
  • 16. what "simple" isn’t ... familiar / convenient
  • 17. what "simple" isn’t ... familiar / convenient small / concise
  • 18. what "simple" isn’t ... familiar / convenient small / concise beautiful / elegant
  • 19. “Simplicity -- the art of maximizing the amount of work not done -- is essential.” from the agile principles
  • 20. YAGNI from the agile principles “Simplicity -- the art of maximizing the amount of work not done -- is essential.”
  • 21. “Technical excellence and good design enhances agility.” from the agile principles
  • 22. Martin Fowler Design is there to enable you to keep changing the software easily.
  • 23. when it comes to design ...
  • 24. COMPLEXITY SUCKS SIMPLICITY RULES
  • 25. COMPLEXITY SUCKS ...
  • 26. COMPLEXITY SUCKS ... … your brain power
  • 27. COMPLEXITY SUCKS ... … your brain power
  • 28. Rich Hickey Once your software is of a certain size, complexity is gonna dominate what you can do.
  • 29. essential complexity
  • 30. essential complexity your code
  • 31. essential complexity your codelibraries frameworks
  • 32. essential complexity language runtime your codelibraries frameworks
  • 33. accidental complexity essential complexity
  • 34. SIMPLICITY RULES ...
  • 35. SIMPLICITY RULES ... … are …
  • 36. SIMPLICITY RULES ... … are … The 4 Rules of Simple Design
  • 37. SIMPLICITY RULES ... … are … The 4 Rules of Simple Design 1) passes all tests
  • 38. SIMPLICITY RULES ... … are … The 4 Rules of Simple Design 1) passes all tests 2) clear, expressive names
  • 39. SIMPLICITY RULES ... … are … The 4 Rules of Simple Design 1) passes all tests 2) clear, expressive names 3) no duplication
  • 40. SIMPLICITY RULES ... … are … The 4 Rules of Simple Design 1) passes all tests 2) clear, expressive names 3) no duplication 4) minimal
  • 41. rule #4: minimal
  • 42. the less code, the better
  • 43. code folding
  • 44. code generators
  • 45. dependency managers
  • 46. stop typing. think!
  • 47. test-first (TDD / BDD)
  • 48. rule #3: no duplication
  • 49. primitive obsession duplication in behavior
  • 50. data clump duplication in structure
  • 51. refactoring
  • 52. rule #2: clear, expressive names
  • 53. small, focused methods reduce cyclomatic complexity
  • 54. small, focused classes single responsibility
  • 55. AccountService AccountManager AccountHandler AccountUtils AccountHelper AccountImpl AccountData AccountDTO AccountInfo AccountDetails AccountObject AbstractAccount BaseAccount CustomAccount SimpleAccount
  • 56. refactoring
  • 57. rule #1: passes all tests
  • 58. unit testing
  • 59. testability & good design
  • 60. testability & good design (but not integration tests)
  • 61. inheritance-based design
  • 62. wget -qO- http://c2.com/ | tr -cs '[:alpha:]' 'n' | sort | uniq composition
  • 63. dependencies
  • 64. auto-import
  • 65. refactoring tools
  • 66. A G F D C introduce indirection
  • 67. A B E G F D C introduce indirection
  • 68. A B E G F D C follow the law of Demeter introduce indirection
  • 69. modularity
  • 70. coupling
  • 71. add an interface?
  • 72. layered architectures
  • 73. add remoting? SOAP
  • 74. enterprise grade decoupling? ESB
  • 75. enterprise grade decoupling? ESB assumptions assumptions
  • 76. interface segregation
  • 77. tell, don’t ask high cohesion
  • 78. dependency inversion role
  • 79. anti-corruption layer adapter role
  • 80. notify Payment Order Auditor Financial Event Listener Mongo Audit Trail log Audit Trail Mongo Audit Records insert
  • 81. Payment Order Audit DAO Audit DAO Impl insert
  • 82. further decoupling queue publish subscribe
  • 83. use cases & business rules framework persistence framework web DB infrastructure messaging QUEUE task scheduler WS
  • 84. Domain Logic Framework Framework
  • 85. Domain Logic Domain Logic Framework Framework accidental complexity complexity leak
  • 86. @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>(); }
  • 87. the law of leaky abstractions
  • 88. home-grown frameworks
  • 89. libraries
  • 90. state & side effects
  • 91. values & pure functions
  • 92. functional style imperative style
  • 93. functional style expressions imperative style statements
  • 94. functional style expressions immutable values imperative style statements mutable state
  • 95. functional style expressions immutable values data transformations imperative style statements mutable state side effects
  • 96. functional style expressions immutable values data transformations recursion & polymorphism imperative style statements mutable state side effects looping & branching
  • 97. stepping out of comfort zone
  • 98. Edsger Dijkstra (1980) Computing's central challenge, "How not to make a mess of it", has not been met.
  • 99. I‘m done