+ All Categories
Home > Software > SRP Everywhere

SRP Everywhere

Date post: 04-Aug-2015
Category:
Upload: gourav-tiwari
View: 170 times
Download: 1 times
Share this document with a friend
13
SRP Everywhere Make your application SOLID
Transcript
Page 1: SRP Everywhere

SRP EverywhereMake your application SOLID

Page 2: SRP Everywhere

SRP

● What

● Why

● How

Page 3: SRP Everywhere
Page 5: SRP Everywhere

Why?

Page 6: SRP Everywhere

Some ‘good’ code examples

● Long methods● Long Controllers/Services● Long Models● Long Classes/Modules● Are you adding to ‘legacy’?

Page 7: SRP Everywhere

Pile-on-game!

Page 8: SRP Everywhere

http://blog.codeclimate.com/blog/2013/08/07/deciphering-ruby-code-metrics/

Page 9: SRP Everywhere
Page 10: SRP Everywhere

Class/Module

1. … should have one responsibility2. Responsibility is defined by business3. If there is more than one responsibility follow

step #1

Page 11: SRP Everywhere

Where else?

● Can methods follow SRP?● Can services follow SRP?● Can design follow SRP?

Page 12: SRP Everywhere

How to identify and work?

● Realistic and relevant naming● Think before ‘Pile-On’● Reassess business definition

Page 13: SRP Everywhere

Recommended