SlideShare a Scribd company logo
IS YOUR CODE SOLID ENOUGH?
PART 1 : JUMP START
BY BUYUNG BAHARI
WHAT IS SOLID?
• The acronym SOLID stands for Single Responsibility Principle, Open-Closed
Principle, Liskov Substitution Principle, Interface Segregation Principle, and
Dependency Inversion Principle
• SOLID is a set of software design principles that can be used in conjunction
with object-oriented programming and design. Robert C. Martin introduced
the underlying concepts of SOLID in 1995 with his 11 commandments of
object-oriented programming (OOP). Michael Feathers coined the acronym
SOLID in the early 2000s as a mnemonic device for remembering the first five
concepts.
WHAT IS THE SOLID PURPOSE?
• Because SOLID is a set of design principles, it does not teach
people how to program. Instead, SOLID principles help
programmers write better code
• The goal is code will be more robust and usable
WHY SOLID?
• The answer to “Why SOLID?” is simply that SOLID principles
produce better code
• SOLID principles to counteract developers habits of writing code
containing thousands of lines and numerous methods or functions
in a class
WHY SOLID?
• Dirty code detector.
• Does the code implement a design pattern?
• Adopting a design pattern in your code or program is not compulsory
• Use your best judgment to decide whether or not you want to implement patterns
• Patterns provide an extra, coated layer to your program so that you can write robustly with
little chance of falling.
• Is the code tightly coupled?
• In software engineering, coupling is the manner and degree of interdependence between
software modules; a measure of how closely connected two routines or modules are
• This means your application or software is tightly coupled, which means your code qualifies as
dirty code
WHY SOLID?
• Dirty code detector.
• Is the code testable?
• Advantages the code is testable
• It reduces the reworking time needed due to any unrecovered issue.
• It provides ability-testing code within code.
• It reduces the time needed for debugging code—with the help of test-driven development
(TDD) we can easily and quickly locate problems.
• It allows for easy determination of whether or not recent changes or refactoring broke the
code.
• Writing tests may be unpleasant and time-consuming, but tests are important
• TDD helps us to improve code quality and draw our focus to the main purpose of our task
WHY SOLID?
• Dirty code detector.
• Is the code human readable?
• Because your code will be read by humans, it should be meaningful code.
• In order to make your method name meaningful, don’t hesitate to use a long name such as Is
ValidForCharactersOnly
• Visit your code and see if you can read it. If not, that means you are writing bad code.
• Is the code duplicated?
• Create a Common class if you can’t decide where to place your common code
• avoid and remove any redundant code
• It’s a good idea to visit your code many times, and in different ways, in order to check for
redundancy
• For example, you can write Console.WriteLine("SOLID Principles Succinctly!"); instead of
System.Console.WriteLine("SOLID Principles Succinctly!"); if you have already added
‘namespace.’ In this case, ‘System’ is redundant and can be removed.
WHY SOLID?
• Dirty code detector.
• Is the code too lengthy to understand?
• Avoid writing lengthy code.
• A function can be hard to understand if it contains thousands of lines.
• Lengthy code caused hard to understand especially for new Developers.
• We can mark our code as bad code if we are writing lengthy functions or methods when we
could instead break them into small and meaningful functions.
 Is your code SOLID enough?
 Is your code SOLID enough?
SOLID UNDERSTANDING
• SOLID is a set of design principles, and these principles help a programmer write better code
SOLID UNDERSTANDING
DESIGN PATTERNS VS. DESIGN PRINCIPLES
SOLID UNDERSTANDING
DESIGN PATTERNS VS. DESIGN PRINCIPLES
SOLID UNDERSTANDING
PRINCIPLES OF OBJECT-ORIENTED DESIGN (OOD)
Robert C. Martin introduced
the underlying concepts of
SOLID in 1995 with his 11
commandments of object-
oriented programming
(OOP).
SOLID UNDERSTANDING
PRINCIPLES OF OBJECT-ORIENTED DESIGN (OOD)
SOLID UNDERSTANDING
• SOLID principles are neither laws nor rules—they are principles intended to help us to write neat code. By
following SOLID principles, our code can be easily extended and maintained
• Single Responsibility Principle
• A class should have only one responsibility. Let’s say our class is responsible for saving data. That means it should not also be
responsible for retrieving data or any other tasks.
• Open-Closed Principle
• Once a class has been written, it should not allow anyone to make changes. No one should be able to go back and amend the
class code in order to implement new functionalities.
• Liskov Substitution Principle
• A dependent object should be able to use any object of type parent object.
• Interface Segregation Principle
• A smaller interface is recommended. If an interface has one method, there will be only one place to change if we need to change
the code. However, in the case of interfaces with more methods, there might be more reasons for change.
• Dependency Inversion Principle
• Put simply, this addresses loose coupling. With the help of DIP, we can write code that does not depend upon concrete classes.
THANK YOU
TO BE CONTINUE….. IS YOUR CODE SOLID ENOUGH?
PART 2 : Single Responsibility Principle

More Related Content

PDF
The Role of IT Architect in Startup Company
PPTX
Software Architecture Fundamentals Part-1 Architecture soft skill
PPTX
The five expertise of a software architect
PPTX
The Role of the Software Architect (short version)
PDF
Taming Big Balls of Mud with Diligence, Agile Practices, and Hard Work
PPTX
To document or not to document? An exploratory study on developers' motivatio...
PDF
What a Good Software Architect Does
PPTX
Reducing Technical Debt
The Role of IT Architect in Startup Company
Software Architecture Fundamentals Part-1 Architecture soft skill
The five expertise of a software architect
The Role of the Software Architect (short version)
Taming Big Balls of Mud with Diligence, Agile Practices, and Hard Work
To document or not to document? An exploratory study on developers' motivatio...
What a Good Software Architect Does
Reducing Technical Debt

What's hot (20)

PDF
Emertxe : Linux training portfolio
PPTX
Tdd 4 everyone full version
PPTX
Career Path Planning
PPTX
Software architecture introduction
PDF
Software architect - roles & responsabilities
PDF
Implement OpenSAMM on blibli.com
PPTX
CS519 - Visual Software Evolution Reconstruction
PPTX
The Role of the Software Architect
PDF
Six Steps to Conversation Driven Development
PDF
Big Ball of Mud: Software Maintenance Nightmares
PPTX
CS 584 - Aligning development tools with the way programmers think about code...
PDF
CNS Presentation
PPTX
Are You an Accidental or Intention Software Architect
PPTX
Basics of Software Architecture for .NET Developers
PDF
Codurance Courses: Crafted Design
PDF
Utah dot Gov - Site Architecture
PDF
Composable Software Architecture with Spring
PDF
Building an End-to-End Test Automation Pipeline for Conversational AI | Rasa ...
PPTX
Introducing systems analysis, design & development Concepts
Emertxe : Linux training portfolio
Tdd 4 everyone full version
Career Path Planning
Software architecture introduction
Software architect - roles & responsabilities
Implement OpenSAMM on blibli.com
CS519 - Visual Software Evolution Reconstruction
The Role of the Software Architect
Six Steps to Conversation Driven Development
Big Ball of Mud: Software Maintenance Nightmares
CS 584 - Aligning development tools with the way programmers think about code...
CNS Presentation
Are You an Accidental or Intention Software Architect
Basics of Software Architecture for .NET Developers
Codurance Courses: Crafted Design
Utah dot Gov - Site Architecture
Composable Software Architecture with Spring
Building an End-to-End Test Automation Pipeline for Conversational AI | Rasa ...
Introducing systems analysis, design & development Concepts
Ad

Similar to Is your code SOLID enough? (20)

PPTX
SOLID_Principles_Explained_Presentation.pptx
PPTX
SOLID Principles
PPTX
Becoming a better developer by using the SOLID design principles
PDF
Solid OO & Clean Coding is essential to successful Agile development
PDF
SOLID design principles in Ruby
PPTX
PPTX
An Introduction to the SOLID Principles
PDF
Solid principle
PPTX
GDSC - SOLID Principles session.pptx
PPTX
S.O.L.I.D. principles of software development
PDF
Quick Intro to Clean Coding
PPTX
Clean code: SOLID
PPTX
Clean code: SOLID (iOS)
PPTX
SOLID Principles of Refactoring Presentation - Inland Empire User Group
PPTX
Clean Code (David Frame) - PHPBelfast Meetup 22/02/24
PDF
SOLID Principles, Building reusable, maintainable, scalable and testable soft...
PPTX
Establishing a SOLID Foundation
PPTX
Clean code
PPTX
Object Oriented Design SOLID Principles
SOLID_Principles_Explained_Presentation.pptx
SOLID Principles
Becoming a better developer by using the SOLID design principles
Solid OO & Clean Coding is essential to successful Agile development
SOLID design principles in Ruby
An Introduction to the SOLID Principles
Solid principle
GDSC - SOLID Principles session.pptx
S.O.L.I.D. principles of software development
Quick Intro to Clean Coding
Clean code: SOLID
Clean code: SOLID (iOS)
SOLID Principles of Refactoring Presentation - Inland Empire User Group
Clean Code (David Frame) - PHPBelfast Meetup 22/02/24
SOLID Principles, Building reusable, maintainable, scalable and testable soft...
Establishing a SOLID Foundation
Clean code
Object Oriented Design SOLID Principles
Ad

More from SARCCOM (19)

PDF
Week 3 Deep Learning And POS Tagging Hands-On
PDF
Week 2 Sentiment Analysis Using Machine Learning
PDF
Week 1 Natural Language Processing Introduction
PDF
The Secret of Most Wanted Geek
PDF
Fundamental of Machine Learning
PDF
Data Warehousing Tools on Data Ecosystem
PDF
Startup Engineering Culture
PDF
Menggapai Paripurna Rekayasa
PPTX
Requirement Gathering Jump Start
PDF
Legacy code - Taming The Beast
PPTX
The Role of IT Architect in Enterprise Company (Garuda Indonesia)
PDF
Blibli Web Application Security Policy Enforcement Point
PDF
Architecting for Huper Growth and Great Engineering Culture
PPTX
Software Architecture Introduction
PDF
Telco Business & Technology
PDF
Best Practice In Software Development
PDF
The Evolution of Software for a Startup
PPTX
How to work with us? We are Gen Y!
PPTX
Managing Security in Agile Culture
Week 3 Deep Learning And POS Tagging Hands-On
Week 2 Sentiment Analysis Using Machine Learning
Week 1 Natural Language Processing Introduction
The Secret of Most Wanted Geek
Fundamental of Machine Learning
Data Warehousing Tools on Data Ecosystem
Startup Engineering Culture
Menggapai Paripurna Rekayasa
Requirement Gathering Jump Start
Legacy code - Taming The Beast
The Role of IT Architect in Enterprise Company (Garuda Indonesia)
Blibli Web Application Security Policy Enforcement Point
Architecting for Huper Growth and Great Engineering Culture
Software Architecture Introduction
Telco Business & Technology
Best Practice In Software Development
The Evolution of Software for a Startup
How to work with us? We are Gen Y!
Managing Security in Agile Culture

Recently uploaded (20)

PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PPTX
Odoo POS Development Services by CandidRoot Solutions
PPTX
Online Work Permit System for Fast Permit Processing
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PPTX
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PPTX
ManageIQ - Sprint 268 Review - Slide Deck
PPTX
L1 - Introduction to python Backend.pptx
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PDF
PTS Company Brochure 2025 (1).pdf.......
PDF
medical staffing services at VALiNTRY
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PDF
Digital Strategies for Manufacturing Companies
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PPTX
ISO 45001 Occupational Health and Safety Management System
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PPT
Introduction Database Management System for Course Database
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
Wondershare Filmora 15 Crack With Activation Key [2025
Odoo POS Development Services by CandidRoot Solutions
Online Work Permit System for Fast Permit Processing
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
How to Migrate SBCGlobal Email to Yahoo Easily
ManageIQ - Sprint 268 Review - Slide Deck
L1 - Introduction to python Backend.pptx
Design an Analysis of Algorithms I-SECS-1021-03
PTS Company Brochure 2025 (1).pdf.......
medical staffing services at VALiNTRY
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
Digital Strategies for Manufacturing Companies
Which alternative to Crystal Reports is best for small or large businesses.pdf
ISO 45001 Occupational Health and Safety Management System
Internet Downloader Manager (IDM) Crack 6.42 Build 41
Introduction Database Management System for Course Database
Upgrade and Innovation Strategies for SAP ERP Customers

Is your code SOLID enough?

  • 1. IS YOUR CODE SOLID ENOUGH? PART 1 : JUMP START BY BUYUNG BAHARI
  • 2. WHAT IS SOLID? • The acronym SOLID stands for Single Responsibility Principle, Open-Closed Principle, Liskov Substitution Principle, Interface Segregation Principle, and Dependency Inversion Principle • SOLID is a set of software design principles that can be used in conjunction with object-oriented programming and design. Robert C. Martin introduced the underlying concepts of SOLID in 1995 with his 11 commandments of object-oriented programming (OOP). Michael Feathers coined the acronym SOLID in the early 2000s as a mnemonic device for remembering the first five concepts.
  • 3. WHAT IS THE SOLID PURPOSE? • Because SOLID is a set of design principles, it does not teach people how to program. Instead, SOLID principles help programmers write better code • The goal is code will be more robust and usable
  • 4. WHY SOLID? • The answer to “Why SOLID?” is simply that SOLID principles produce better code • SOLID principles to counteract developers habits of writing code containing thousands of lines and numerous methods or functions in a class
  • 5. WHY SOLID? • Dirty code detector. • Does the code implement a design pattern? • Adopting a design pattern in your code or program is not compulsory • Use your best judgment to decide whether or not you want to implement patterns • Patterns provide an extra, coated layer to your program so that you can write robustly with little chance of falling. • Is the code tightly coupled? • In software engineering, coupling is the manner and degree of interdependence between software modules; a measure of how closely connected two routines or modules are • This means your application or software is tightly coupled, which means your code qualifies as dirty code
  • 6. WHY SOLID? • Dirty code detector. • Is the code testable? • Advantages the code is testable • It reduces the reworking time needed due to any unrecovered issue. • It provides ability-testing code within code. • It reduces the time needed for debugging code—with the help of test-driven development (TDD) we can easily and quickly locate problems. • It allows for easy determination of whether or not recent changes or refactoring broke the code. • Writing tests may be unpleasant and time-consuming, but tests are important • TDD helps us to improve code quality and draw our focus to the main purpose of our task
  • 7. WHY SOLID? • Dirty code detector. • Is the code human readable? • Because your code will be read by humans, it should be meaningful code. • In order to make your method name meaningful, don’t hesitate to use a long name such as Is ValidForCharactersOnly • Visit your code and see if you can read it. If not, that means you are writing bad code. • Is the code duplicated? • Create a Common class if you can’t decide where to place your common code • avoid and remove any redundant code • It’s a good idea to visit your code many times, and in different ways, in order to check for redundancy • For example, you can write Console.WriteLine("SOLID Principles Succinctly!"); instead of System.Console.WriteLine("SOLID Principles Succinctly!"); if you have already added ‘namespace.’ In this case, ‘System’ is redundant and can be removed.
  • 8. WHY SOLID? • Dirty code detector. • Is the code too lengthy to understand? • Avoid writing lengthy code. • A function can be hard to understand if it contains thousands of lines. • Lengthy code caused hard to understand especially for new Developers. • We can mark our code as bad code if we are writing lengthy functions or methods when we could instead break them into small and meaningful functions.
  • 11. SOLID UNDERSTANDING • SOLID is a set of design principles, and these principles help a programmer write better code
  • 12. SOLID UNDERSTANDING DESIGN PATTERNS VS. DESIGN PRINCIPLES
  • 13. SOLID UNDERSTANDING DESIGN PATTERNS VS. DESIGN PRINCIPLES
  • 14. SOLID UNDERSTANDING PRINCIPLES OF OBJECT-ORIENTED DESIGN (OOD) Robert C. Martin introduced the underlying concepts of SOLID in 1995 with his 11 commandments of object- oriented programming (OOP).
  • 15. SOLID UNDERSTANDING PRINCIPLES OF OBJECT-ORIENTED DESIGN (OOD)
  • 16. SOLID UNDERSTANDING • SOLID principles are neither laws nor rules—they are principles intended to help us to write neat code. By following SOLID principles, our code can be easily extended and maintained • Single Responsibility Principle • A class should have only one responsibility. Let’s say our class is responsible for saving data. That means it should not also be responsible for retrieving data or any other tasks. • Open-Closed Principle • Once a class has been written, it should not allow anyone to make changes. No one should be able to go back and amend the class code in order to implement new functionalities. • Liskov Substitution Principle • A dependent object should be able to use any object of type parent object. • Interface Segregation Principle • A smaller interface is recommended. If an interface has one method, there will be only one place to change if we need to change the code. However, in the case of interfaces with more methods, there might be more reasons for change. • Dependency Inversion Principle • Put simply, this addresses loose coupling. With the help of DIP, we can write code that does not depend upon concrete classes.
  • 17. THANK YOU TO BE CONTINUE….. IS YOUR CODE SOLID ENOUGH? PART 2 : Single Responsibility Principle