Slide 1

Slide 1 text

CLEAN DESIGN SOFTWARE LEMi ORHAN ERGiN agile software craftsman @ iyzico

Slide 2

Slide 2 text

No content

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

No content

Slide 6

Slide 6 text

No content

Slide 7

Slide 7 text

No content

Slide 8

Slide 8 text

No content

Slide 9

Slide 9 text

No content

Slide 10

Slide 10 text

No content

Slide 11

Slide 11 text

code design process team management organization tests customer ux & ui culture office architecture infrastructure ux & ui meetings security

Slide 12

Slide 12 text

things smell… and if something smells bad, it means it is not clean

Slide 13

Slide 13 text

LEMi ORHAN ERGiN agile software craftsman @ iyzico /lemiorhan lemiorhanergin.com @lemiorhan agile practice lead at iyzico developing software since 2001 worked at Sony, eBay/GittiGidiyor, ACM consultant, architect, mentor, developer founder of Software Craftsmanship Turkey ex community leader of Agile Turkey meetup.scturkey.org agileturkey.org dev.iyzipay.com

Slide 14

Slide 14 text

Jack W. Reeves The C++ Journal Vol. 2, No. 2. 1992 http://user.it.uu.se/~carle/softcraft/notes/Reeve_SourceCodeIsTheDesign.pdf What is So"ware Design?

Slide 15

Slide 15 text

Source code is the real so"ware design Designing so!ware is an exercise in managing complexity Jack W. Reeves What is Software Design? The C++ Journal Vol. 2, No. 2. 1992 http://user.it.uu.se/~carle/softcraft/notes/Reeve_SourceCodeIsTheDesign.pdf

Slide 16

Slide 16 text

The so"ware design is not complete until it has been coded and tested Testing is part of the process of refining the design Jack W. Reeves What is Software Design? The C++ Journal Vol. 2, No. 2. 1992 http://user.it.uu.se/~carle/softcraft/notes/Reeve_SourceCodeIsTheDesign.pdf

Slide 17

Slide 17 text

Programming Source Code SOFTWARE DESIGN Automated Testing (Unit, Functional, etc.)

Slide 18

Slide 18 text

The very first value of so"ware is Robert C. Martin Author of Clean Code and Clean Coder Owner of cleancoders.com training site …

Slide 19

Slide 19 text

to tolerate and facilitate on-going changes Robert C. Martin Author of Clean Code and Clean Coder Owner of cleancoders.com training site The very first value of so"ware is

Slide 20

Slide 20 text

Each city has to be renewed in order to meet the needs of its populace. So!ware-intensive systems are like that. Grady Booch Developed UML Wrote foreword to “Design Patterns” and “Technical Debt” books Istanbul, Turkey Credit: European Space Imaging

Slide 21

Slide 21 text

Programming Source Code SOFTWARE DESIGN Refactoring Automated Testing (Unit, Functional, etc.)

Slide 22

Slide 22 text

Programming Source Code SOFTWARE DESIGN Refactoring Automated Testing (Unit, Functional, etc.) Testing and Refactoring 
 are first class citizens of so"ware design Tests should pass Refactoring should be continuous

Slide 23

Slide 23 text

Programming Source Code SOFTWARE DESIGN Refactoring Automated Testing (Unit, Functional, etc.)

Slide 24

Slide 24 text

Programming Source Code SOFTWARE DESIGN Refactoring clean? Automated Testing (Unit, Functional, etc.)

Slide 25

Slide 25 text

COUPLING When readfile() is changed, do you change writeFile() too? It shows how many places we need to change

Slide 26

Slide 26 text

Two elements are loosely coupled if they are not shown in the same diff Kent Beck The creator of extreme programming One of the signatories of the Agile Manifesto Pioneered software design patterns and TDD

Slide 27

Slide 27 text

COHESION Do you search a lot where to change? It shows how easy to find the places we need to change

Slide 28

Slide 28 text

How many files at any one time is still open for edit shows the level of cohesion Nat Pryce Co-Author of Growing Object-Oriented Software Guided by Tests Early adopter of XP

Slide 29

Slide 29 text

Programming Source Code SOFTWARE DESIGN Refactoring Low Coupling High Cohesion Automated Testing (Unit, Functional, etc.)

Slide 30

Slide 30 text

Programming Source Code SOFTWARE DESIGN Refactoring Automated Testing (Unit, Functional, etc.) Low Coupling High Cohesion Refactor namings (how) mailer.useGmailSmtpSendEmail (what) mailer.sendEmail (why) mailer.sendActivationEmail Reveal what you are doing or why you are doing, not how you are doing

Slide 31

Slide 31 text

Refactor namings Programming Source Code SOFTWARE DESIGN Refactoring Automated Testing (Unit, Functional, etc.) Low Coupling High Cohesion manager handler helper utils facade service validator converter repository wrapper interceptor controller parser gateway generator dto, vo, entity Know what these really means

Slide 32

Slide 32 text

Split methods, Create new abstractions, Re-organize code Programming Source Code SOFTWARE DESIGN Refactoring Automated Testing (Unit, Functional, etc.) Low Coupling High Cohesion Be aware of leaky abstractions. Do not expose details and limitations of its underlying implementation to its users that should ideally be hidden away.

Slide 33

Slide 33 text

No content

Slide 34

Slide 34 text

Programming Source Code Refactoring Low Coupling High Cohesion Automated Testing (Unit, Functional, etc.) and Code Review Pair Programming

Slide 35

Slide 35 text

When code is reviewed, the design will be cleaner. Programming Source Code Refactoring Automated Testing (Unit, Functional, etc.) Low Coupling High Cohesion and Code Review Pair Programming Pair prog makes you code cheaper due to spending less time in decision taking, bug fixing and debugging.

Slide 36

Slide 36 text

Find and remove duplications Programming Source Code Refactoring Automated Testing (Unit, Functional, etc.) Low Coupling High Cohesion and Code Review Pair Programming It’s not about code duplication, it’s about knowledge duplication. Don’t repeat yourself. Every piece of knowledge should have one and only one representation.

Slide 37

Slide 37 text

Programming Source Code Refactoring Automated Testing (Unit, Functional, etc.) Low Coupling High Cohesion and Code Review Pair Programming Keep it SMALL classes, interfaces, responsibilities, methods, modules, components… use design pa!erns wisely

Slide 38

Slide 38 text

Programming Source Code Refactoring Automated Testing (Unit, Functional, etc.) Low Coupling High Cohesion and Code Review Pair Programming these STOP Singletons? Sharing state Static & new keywords Framework slave coding Premature optimization Primitive obssession Huge upfront design Controling flows with exceptions or use them wisely

Slide 39

Slide 39 text

Programming Source Code Refactoring Low Coupling High Cohesion Automated Testing (Unit, Functional, etc.) and Code Review Pair Programming

Slide 40

Slide 40 text

LEMi ORHAN ERGiN agile software craftsman @ iyzico /lemiorhan lemiorhanergin.com @lemiorhan