Upload
dmitry-kandalov
View
1.174
Download
0
Tags:
Embed Size (px)
DESCRIPTION
Slides with notes from my talk about SOLID principles.
Citation preview
Why?
Why I still program?
NO hacking
NO nerds
NO bit-twiddling
Literate programming
Why design?
maintenance
less bugs
reuse?
peace of mind
satisfaction
fun
principles != rules
Single Responsibility
Principle
Portfolio
Book
InstrumentPosition
value: double
Main
ServiceClient
2: new 3: use
1: new
4: use
Main
ServiceClient
Context
2: use
3: use
1.2: new 1.1: new
1: new
Open/Closed Principle
TG
<<interface>>
BPCListener
<<interface>>
BPCManager
<<interface>>
SnapshotProvider
uses
supply
notify
requests
create
OCP is emergent
Liskov Substitution Principle
@IViolateLSP
Interface Segregation Principle
BookPositionNode
<<interface>>
ResubscribingNode AbsPosNode
StateMachine
NodeUser
uses
uses
<<interface>>
BigService
<<interface>>
Service1<<interface>>
Service2<<interface>>
Service3
Client1 Client2 Client3
Dependency Inversion Principle
Client Service
Client<<interface>>
Service
ServiceImpl
Client
<<interface>>
ServiceServiceImpl
client
service
Client<<interface>>
Service
ServiceImpl
client
service
Client<<interface>>
Service
ServiceImpl
client
service
api
SRP
OCP
LSP
ISP
DIP
REP
CRP
CCP
ADP
SDP
SAP
What else?
idea code
F**k Design
Zen Coding
not scalable
totally art
Thanks!