Slide 1

Slide 1 text

Software Architecture Tool Belt: Design Patterns and Code Smells Nico Rehwaldt @nikku

Slide 2

Slide 2 text

Context: Refactoring We continuously ensure that our software stays helthy, do we? 1

Slide 3

Slide 3 text

Context: Build for Understandability We spend most of our time reading (and understanding) software, not writing it. We better build towards understandability, too. 2

Slide 4

Slide 4 text

Context: Why do humans build software? Building software is hard (still requires humans to do so) There is no silver bullet, software can work in so many ways Goal: Aim for the good enough and keep it 3

Slide 5

Slide 5 text

Levels of Understanding line of code code unit cross component systems 4

Slide 6

Slide 6 text

Design Pattern: What is it? In software engineering, a software design pattern is a general, reusable solution to a commonly occurring problem within a given context in software design. — Wikipedia 5

Slide 7

Slide 7 text

Design Pattern: What is it? Defines roles and responsibilities in cross component communication pattern as well as the result being achieved / problem being solved. 6

Slide 8

Slide 8 text

Design Pattern: Why should I care? A common knowledge and visibility of design patterns in the code base promotes understandability. Example: Say we use the observer pattern here and the recipient immediately understands the problem being solved. 7

Slide 9

Slide 9 text

Design Pattern: Resources Refactoring Guru Wikipedia: Software design pattern Book: Gang of Four - Elements of Reusable Object- Oriented Software 8

Slide 10

Slide 10 text

Code Smell: What is it? In computer programming, a code smell is any characteristic in the source code of a program that possibly indicates a deeper problem. Determining what is and is not a code smell is subjective, and varies by language, developer, and development methodology. — Wikipedia 9

Slide 11

Slide 11 text

Code Smell: Why should I care? Gives your feeling Something smells like here a name. You still need to evaluate the impact and deal with it yourself. 10

Slide 12

Slide 12 text

Code Smell: Resources Anti Pattern Martin Fowler on Code Smells How to write unmaintainable code 11

Slide 13

Slide 13 text

Thanks 12