SlideShare a Scribd company logo
SOLID as OOP abstraction
Paweł Klimczyk
Gemotial 2016
About me
•Software engineer
•Running Gemotial Software Studio
•Co-organizer ofWrocNET
•Blog: http://blog.klimczyk.pl
•E-mail: pawel@klimczyk.pl
•Twitter: @pwlklm
•GitHub: pawelklimczyk
Software Quality/SOLID
jobesto.com
C#/.NET/BizTalk
netdevelopers.pl
BJJ
What I do
What is OOP ?
•Abstraction
•Encapsulation
•Inheritance
•Polymorphism
OOP (r)evolution
•Simula 67, Smalltalk
•Ada, Lisp
•C#, Java
OOP bad habits- Code Smells
• Duplicate Code
• Long Method
• Comments
• Long Parameter List
• Large Class
• Switch Statements
• Parallel Inheritance Hierarchies
• Conditional Complexity
• Combinitorial Explosion
• Uncommunicative Name
• Dead Code
• Inconsistent Names
• Temporary Field
OOP bad habits - Design Smells
• Alternative Classes with Different
Interfaces
• Primitive ObsessionData Class
• Data Clumps
• Refused Bequest
• Inappropriate Intimacy
• Indecent Exposure
• Feature Envy
• Lazy Class
• Message Chains
• Middle Man
• Divergent Change
• Shotgun Surgery
• Parallel Inheritance Hierarchies
• Incomplete Library Class
• Solution Sprawl
Technical debt trap
•Hard to extend rotten code
•The longer we wait to remove the smells, the
more it will cost
SOLID – the beginning
Michael Feathers Robert C.Martin
Year ~2000
Occam's razor principle
Occam's razor is a problem-solving principle devised by
William of Ockham.The principle states that among
competing hypotheses, the one with the fewest
assumptions should be selected. Other, more complicated
solutions may ultimately prove correct, but—in the
absence of certainty—the fewer assumptions that are
made, the better.
SOLID
•Single Responsibility Principle (SRP)
•Open-Closed Principle (OCP)
•Liskov Substitution Principle (LSP)
•Interface Segregation Principle (ISP)
•Dependency Inversion Principle (DIP)
Single Responsibility Principle (SRP)
A class or similar unit of code should have one responsibility only and, therefore,
only one reason to change.
Single Responsibility Principle (SRP)
Open-Closed Principle (OCP)
You should be able to extend a classes behavior, without modifying it.
Open-Closed Principle (OCP)
Liskov Substitution Principle (LSP)
Derived classes must be substitutable for their base classes.
Liskov Substitution Principle (LSP)
Interface Segregation Principle (ISP)
Make fine grained interfaces that are client specific.
Clients should not be forced to depend upon interfaces that they don't use.
Interface Segregation Principle (ISP)
Dependency Inversion Principle (DIP)
Depend on abstractions, not on concretions.
High level modules should not depend upon low level modules and abstractions
should not depend upon details.
Dependency Inversion Principle (DIP)
Other principles
•Keep It Simple Stupid (KISS)
•You Ain’t Gonna Need It (YAGNI)
•Don’t RepeatYourself (DRY)
References
• http://objectmentor.com/Images/photo_feathers.jpg
• http://upload.wikimedia.org/wikipedia/commons/thumb/e/ee/Robert_Cecil
_Martin.png/220px-Robert_Cecil_Martin.png
• http://www.butunclebob.com/ArticleS.UncleBob.PrinciplesOfOod
• SOLID examples:
• https://msdn.microsoft.com/en-us/magazine/dn683797.aspx
Q&A

More Related Content

PPTX
SOLID for Adults
PPTX
Software Quality for Programmers
PPTX
How To Write a Testable Code
PDF
Solid principles of oo design
PPTX
PPTX
Single Responsibility Principle
PPTX
Solid Principles Of Design (Design Series 01)
PDF
Object Oriented Programming Ch3 SRP, DIP, ISP
SOLID for Adults
Software Quality for Programmers
How To Write a Testable Code
Solid principles of oo design
Single Responsibility Principle
Solid Principles Of Design (Design Series 01)
Object Oriented Programming Ch3 SRP, DIP, ISP

What's hot (20)

PPTX
Polyglot
PPTX
Build software like a bag of marbles, not a castle of LEGO®
PPTX
Clean Code III - Software Craftsmanship at SoCal Code Camp San Diego (07/27/2...
PPTX
Clean Code I - Design Patterns and Best Practices at SoCal Code Camp San Dieg...
PPTX
Eurosport's Kodakademi #2
PPTX
Working Effectively With Legacy Code
PPTX
Designing with tests
PDF
Data consistency: Analyse, understand and decide
PPTX
Refactoring Applications using SOLID Principles
KEY
What is open source?
PPTX
Coding in kotlin
PPTX
Real life unit testing tools and practices
PPTX
Clean code presentation
PDF
Code Review Matters and Manners
PDF
Software architecture in a DevOps world
PPTX
Generalization in Auto-Testing. How we put what we had into new Technological...
PDF
GoLang - Why It Matters
PPTX
Some Cool Design Patterns, Practices, and Principles
PPTX
Becoming fully buzzword compliant
PDF
Refactoring for Software Design Smells
Polyglot
Build software like a bag of marbles, not a castle of LEGO®
Clean Code III - Software Craftsmanship at SoCal Code Camp San Diego (07/27/2...
Clean Code I - Design Patterns and Best Practices at SoCal Code Camp San Dieg...
Eurosport's Kodakademi #2
Working Effectively With Legacy Code
Designing with tests
Data consistency: Analyse, understand and decide
Refactoring Applications using SOLID Principles
What is open source?
Coding in kotlin
Real life unit testing tools and practices
Clean code presentation
Code Review Matters and Manners
Software architecture in a DevOps world
Generalization in Auto-Testing. How we put what we had into new Technological...
GoLang - Why It Matters
Some Cool Design Patterns, Practices, and Principles
Becoming fully buzzword compliant
Refactoring for Software Design Smells
Ad

Viewers also liked (14)

PDF
Rethink your architecture - Marten Deinum
PPTX
Fundamentals of oops in .Net
PPTX
Marco Mancuso - Data Context Interaction
PDF
Oop basic overview
PPT
OOP programming
PPT
Oop Introduction
PPTX
Object Oriented Programming - Introduction
PPT
What does OOP stand for?
PPTX
Object Oriented Programming Using C++
PPTX
Basics of Object Oriented Programming in Python
PPT
What is OOP?
PPT
Object-oriented concepts
PPTX
Introduction to Object Oriented Programming
PDF
Object Oriented Programming with Real World Examples
Rethink your architecture - Marten Deinum
Fundamentals of oops in .Net
Marco Mancuso - Data Context Interaction
Oop basic overview
OOP programming
Oop Introduction
Object Oriented Programming - Introduction
What does OOP stand for?
Object Oriented Programming Using C++
Basics of Object Oriented Programming in Python
What is OOP?
Object-oriented concepts
Introduction to Object Oriented Programming
Object Oriented Programming with Real World Examples
Ad

Similar to Solid as OOP abstraction (20)

PPTX
The Solid Principles
PPTX
PDF
Solid principle
PDF
Solid principles
PPTX
SOLID_Principles_Explained_Presentation.pptx
PPTX
An Introduction to the SOLID Principles
PDF
L22 Design Principles
PDF
SOLID Design Principles for Test Automaion
PPTX
SOLID Principles
PDF
Solid - OOD Principles
PPTX
Solid principles
PPT
DesignPrinciples-and-DesignPatterns
PPTX
Programming for a better world
PPTX
Object Oriented Design SOLID Principles
PDF
Understanding SOLID Principles in OOP programming
PPT
Object Oriented Concepts and Principles
PPTX
Birth of a developer
The Solid Principles
Solid principle
Solid principles
SOLID_Principles_Explained_Presentation.pptx
An Introduction to the SOLID Principles
L22 Design Principles
SOLID Design Principles for Test Automaion
SOLID Principles
Solid - OOD Principles
Solid principles
DesignPrinciples-and-DesignPatterns
Programming for a better world
Object Oriented Design SOLID Principles
Understanding SOLID Principles in OOP programming
Object Oriented Concepts and Principles
Birth of a developer

More from Pawel Klimczyk (12)

PPTX
Wrocnet.meeting.info.20180515.109
PPTX
Wrocnet.meeting.info.20180320.107
PPTX
Code Crime Scene
PPTX
Software maintenance
PPTX
Product Roadmap vs Development
PPTX
Code Crime Scene pawel klimczyk
PPTX
Wrocnet #88
PPTX
GeekWeekWro TechSaturdays
PPTX
GeekWeekWro hack4culture
PPTX
Wrocnet #87
PPTX
Wrocnet 86
PPTX
Wrocnet spotkanie 85
Wrocnet.meeting.info.20180515.109
Wrocnet.meeting.info.20180320.107
Code Crime Scene
Software maintenance
Product Roadmap vs Development
Code Crime Scene pawel klimczyk
Wrocnet #88
GeekWeekWro TechSaturdays
GeekWeekWro hack4culture
Wrocnet #87
Wrocnet 86
Wrocnet spotkanie 85

Recently uploaded (20)

PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PDF
System and Network Administraation Chapter 3
PPTX
Transform Your Business with a Software ERP System
PPTX
CHAPTER 2 - PM Management and IT Context
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PPTX
ManageIQ - Sprint 268 Review - Slide Deck
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PPTX
history of c programming in notes for students .pptx
PPTX
L1 - Introduction to python Backend.pptx
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PDF
medical staffing services at VALiNTRY
PDF
PTS Company Brochure 2025 (1).pdf.......
PPTX
Odoo POS Development Services by CandidRoot Solutions
PDF
Understanding Forklifts - TECH EHS Solution
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PPTX
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PDF
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
System and Network Administraation Chapter 3
Transform Your Business with a Software ERP System
CHAPTER 2 - PM Management and IT Context
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
ManageIQ - Sprint 268 Review - Slide Deck
Upgrade and Innovation Strategies for SAP ERP Customers
VVF-Customer-Presentation2025-Ver1.9.pptx
history of c programming in notes for students .pptx
L1 - Introduction to python Backend.pptx
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
medical staffing services at VALiNTRY
PTS Company Brochure 2025 (1).pdf.......
Odoo POS Development Services by CandidRoot Solutions
Understanding Forklifts - TECH EHS Solution
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...

Solid as OOP abstraction

Editor's Notes

  • #6: Ole-Johana Dahl and Kristen Nygaard