SlideShare a Scribd company logo
www.luxoft.com
Do we need SOLID
principles during software
development?
Luxoft Kiev
29.10.2015
Kseniya Shaposhnikova
www.luxoft.com
Content
 What are SOLID principles?
Single Responsibility
Open Close
Liskov Substitution
Interface Segregation
Dependency Inversion
 Project design issues
 SOLID principles pros and cons
www.luxoft.com
What are SOLID principles?
Object-oriented design principles that allow software
engineers eliminate project issues by creating the
best project based on existing properties.
www.luxoft.com
Project design issues
Instability Immobility Viscosity
Tightness Uncertainty
Unjustified
Repetitions
Unjustified
Complexity
www.luxoft.com
Single Responsibility Principle (SRP)
There should be only one reason to change class
www.luxoft.com
Single Responsibility Principle Wrong
www.luxoft.com
Single Responsibility Principle Right
www.luxoft.com
Open Close Principle (OCP)
Software objects (classes, modules, functions, etc.)
should be open to extension but close to
modifications.
 Extension – addition of new behavior types (via abstractions)
 Modification – changes in binary modules
www.luxoft.com
Strategy Pattern
class Strategy
«interface»
EventHandler
+ processEvent(Event) : void
Client
- eventHandler: EventHandler
DailyEventHandler
+ processEvent(Event) : void
MonthlyEventHandler
+ processEvent(Event) : void
www.luxoft.com
Template Method Pattern
class Template Method
ReportGenerator
+ generateReport() : void
+ retrieveData() : void
+ validateData() : void
+ createReport() : void
Client
- reportGenerator: ReportGenerator
WeeklyReportGenerator
+ retrieveData() : void
+ validateData() : void
+ createReport() : void
QuaterlyReportGenerator
+ retrieveData() : void
+ validateData() : void
+ createReport() : void
Report generatorReport(){
Data data retrieveData();
boolean isValid=validateData(data);
if (isValid){
return createReport(data);
}
...
}
www.luxoft.com
Liskov Substitution Principle (LSP)
Subtypes must be able to be replaced by base types.
www.luxoft.com
Collections hierarchy (follows LSP)
www.luxoft.com
Interface Segregation Principle (ISP)
Clients should not become dependent on methods
which they do not need.
www.luxoft.com
Interface Segregation Principle Wrong
class Interface Segregation
«interface»
ITextEditor
+ printContent() : void
+ saveContent() : void
+ copyText() : void
+ pasteText() : void
DesktopEditor
+ printContent() : void
+ saveContent() : void
+ copyText() : void
+ pasteText() : void
OnlineEditor
+ printContent() : void
+ saveContent() : void
+ copyText() : void
+ pasteText() : void
CommandLineEditor
+ printContent() : void
+ saveContent() : void
+ copyText() : void
+ pasteText() : void
www.luxoft.com
Interface Segregation Principle Right
class Interface Segregation
«interface»
UITextEditor
+ copyText() : void
+ pasteText() : void
«interface»
BaseTextEditor
+ printContent() : void
+ saveContent() : void
DesktopEditor
+ copyText() : void
+ printContent() : void
+ pasteText() : void
+ saveContent() : void
OnlineEditor
+ copyText() : void
+ printContent() : void
+ pasteText() : void
+ saveContent() : void
CommandLineEditor
+ printContent() : void
+ saveContent() : void
www.luxoft.com
Dependency Inversion Principle (DIP)
 High-level modules should not depend from low-level
modules. Both module types should depend on abstractions.
 Abstractions should not depend on details. Details should
depend on abstractions.
www.luxoft.com
Dependency Inversion Principle Wrong
class Dependency Inversion
BookingService
+ addBooking() : void
ClientsStorage
+ getClient() : Client
DiscountCalculator
+ calculateDiscount(Client) : double
www.luxoft.com
Dependency Inversion Principle Right
class Dependency Inversion
BookingService
+ addBooking() : void
«interface»
IDiscountCalculator
+ getDiscount(Client) : int
«interface»
IClientsStorage
+ getClient() : Client
ClientsCatalog
+ getClient() : Client
BasicDiscountCalculator
+ getDiscount(Client) : int
www.luxoft.com
Benefits of SOLID principles
 Changes in different parts of system do not affect unrelated parts.
 System is flexible for potential changes due to various abstractions.
 Each part of system can use only those set of exposed that it needs
from interfaces.
 No need to implement unnecessary methods.
 Changes in details do not affect high-level abstractions.
www.luxoft.com
Too many small code modules each having single
responsibility.
 Hard to make changes in modules because it is difficult to predict
which other parts use this small module.
 It’s hard to explore code dependencies because of large number of
modules.
www.luxoft.com
Too many abstractions.
 Create tests on early stages of development.
 Make development cycles short .
 Show results regularly to predict possible changes.
www.luxoft.com
Too many interfaces.
 According to DIP we have to use references to interfaces instead of
references to implementations.
 Do not invert dependencies for classes that remain unchanged.
www.luxoft.com
We have to think over correct invariants on early stages.
 Class invariant is an invariant used to constrain objects of a class.
 The class invariant constrains the state stored in the object.
 Programming by contract can be used.
www.luxoft.com
 We segregate interfaces and have several ones instead of one.
 We have to hold all those references in class that consumes
interfaces.
 Logically group interface methods but do not split them too much if it
really is not needed in your concrete code.
We have to hold references to several interfaces.
www.luxoft.com
What did we talk about?
 Each SOLID principle described
 What issues SOLID principles allow to solve
 Pros and cons of each one

More Related Content

What's hot (20)

PDF
50 nouvelles choses que l'on peut faire avec Java 8
José Paumard
 
PPTX
Git and Github Session
GoogleDevelopersStud1
 
PPTX
PPT FOR EXPLAINING MERKLE tree and SPV.pptx
meena466141
 
PDF
Ethereum-Cryptocurrency (All about Ethereum)
عطاءالمنعم اثیل شیخ
 
PPTX
Docker Kubernetes Istio
Araf Karsh Hamid
 
PPTX
Css3
Deepak Mangal
 
PDF
OpenStack勉強会
Yuki Obara
 
PDF
Decentralised Exchanges - An Introduction
Priyab Satoshi
 
PPTX
Everything You Need To Know About Persistent Storage in Kubernetes
The {code} Team
 
PPTX
ASP.NET Core: The best of the new bits
Ken Cenerelli
 
PPTX
Cryptocurrency and India
Nidhi Gupta
 
PDF
OSMC 2022 | OpenTelemetry 101 by Dotan Horovit s.pdf
NETWAYS
 
PDF
TypeScript - An Introduction
NexThoughts Technologies
 
KEY
Git and GitHub
James Gray
 
PPT
Css lecture notes
Santhiya Grace
 
PDF
Git et les systèmes de gestion de versions
Alice Loeser
 
PDF
01 - Introduction to Hyperledger : A Blockchain Technology for Business
Merlec Mpyana
 
PPTX
Bitcoin, Cryptocurrency, & Blockchain Presentation
MaxWheelock
 
PDF
WebAuthn
Kelley Robinson
 
PDF
#살아있다 #자프링외길12년차 #코프링2개월생존기
Arawn Park
 
50 nouvelles choses que l'on peut faire avec Java 8
José Paumard
 
Git and Github Session
GoogleDevelopersStud1
 
PPT FOR EXPLAINING MERKLE tree and SPV.pptx
meena466141
 
Ethereum-Cryptocurrency (All about Ethereum)
عطاءالمنعم اثیل شیخ
 
Docker Kubernetes Istio
Araf Karsh Hamid
 
OpenStack勉強会
Yuki Obara
 
Decentralised Exchanges - An Introduction
Priyab Satoshi
 
Everything You Need To Know About Persistent Storage in Kubernetes
The {code} Team
 
ASP.NET Core: The best of the new bits
Ken Cenerelli
 
Cryptocurrency and India
Nidhi Gupta
 
OSMC 2022 | OpenTelemetry 101 by Dotan Horovit s.pdf
NETWAYS
 
TypeScript - An Introduction
NexThoughts Technologies
 
Git and GitHub
James Gray
 
Css lecture notes
Santhiya Grace
 
Git et les systèmes de gestion de versions
Alice Loeser
 
01 - Introduction to Hyperledger : A Blockchain Technology for Business
Merlec Mpyana
 
Bitcoin, Cryptocurrency, & Blockchain Presentation
MaxWheelock
 
WebAuthn
Kelley Robinson
 
#살아있다 #자프링외길12년차 #코프링2개월생존기
Arawn Park
 

Viewers also liked (14)

PDF
Refactoring to SOLID Code
Adil Mughal
 
PDF
SOLID PRINCIPLES
Luciano Queiroz
 
PPTX
Solid principles
Monica Rodrigues
 
PPTX
Refactoring Applications using SOLID Principles
Steven Smith
 
PDF
A Checklist for Design Reviews
Tushar Sharma
 
PDF
Applying Design Principles in Practice
Tushar Sharma
 
PPTX
SOLID Principles part 2
Dennis van der Stelt
 
PPTX
S.O.L.I.D. Principles for Software Architects
Ricardo Wilkins
 
PPT
SOLID Design Principles
Andreas Enbohm
 
PPTX
The SOLID Principles Illustrated by Design Patterns
Hayim Makabee
 
PPTX
Building Secure User Interfaces With JWTs (JSON Web Tokens)
Stormpath
 
PPT
Solid principles
Dmitry Kandalov
 
PPT
SOLID principles
Dmitry Kandalov
 
PDF
SOLID Principles and Design Patterns
Ganesh Samarthyam
 
Refactoring to SOLID Code
Adil Mughal
 
SOLID PRINCIPLES
Luciano Queiroz
 
Solid principles
Monica Rodrigues
 
Refactoring Applications using SOLID Principles
Steven Smith
 
A Checklist for Design Reviews
Tushar Sharma
 
Applying Design Principles in Practice
Tushar Sharma
 
SOLID Principles part 2
Dennis van der Stelt
 
S.O.L.I.D. Principles for Software Architects
Ricardo Wilkins
 
SOLID Design Principles
Andreas Enbohm
 
The SOLID Principles Illustrated by Design Patterns
Hayim Makabee
 
Building Secure User Interfaces With JWTs (JSON Web Tokens)
Stormpath
 
Solid principles
Dmitry Kandalov
 
SOLID principles
Dmitry Kandalov
 
SOLID Principles and Design Patterns
Ganesh Samarthyam
 
Ad

Similar to Do we need SOLID principles during software development? (20)

PDF
Modern JavaScript Applications: Design Patterns
Volodymyr Voytyshyn
 
PPT
Intro To AOP
elliando dias
 
PPTX
Rethinking Best Practices
floydophone
 
PDF
Dicoding Developer Coaching #31: Android | Menerapkan Clean Architecture di A...
DicodingEvent
 
PDF
Learning Patterns Lydia Hallie Addy Osmani Josh W Comeau
fatolukaman
 
PDF
The dependency inversion principle
navicorevn
 
PDF
Software Architecture Erosion and Modernization
bmerkle
 
PDF
Javascript spaghetti stirtrek_5_17
Jared Faris
 
PDF
Lezione 03 Introduzione a react
University of Catania
 
PPTX
Micro-Frontends JSVidCon
Amir Zuker
 
PPT
Lunch and learn as3_frameworks
Yuri Visser
 
PDF
"Write once, run everywhere", Oleksii Levzhynskyi
Fwdays
 
KEY
SOLID Design Principles
Samuel Breed
 
PPTX
DevSecCon SG 2018 Fabian Presentation Slides
Fab L
 
PDF
The State of Wicket
Martijn Dashorst
 
DOC
235042632 super-shop-ee
homeworkping3
 
PDF
Git & dev ops come together, right now!
rhirschfeld
 
PPTX
Typescript design patterns applied to sharepoint framework - Sharepoint Satur...
Luis Valencia
 
PDF
Fewd week4 slides
William Myers
 
PDF
CLR_via_CSharp_(Jeffrey_Richter_4th_Edition).pdf
ssuserbe139c
 
Modern JavaScript Applications: Design Patterns
Volodymyr Voytyshyn
 
Intro To AOP
elliando dias
 
Rethinking Best Practices
floydophone
 
Dicoding Developer Coaching #31: Android | Menerapkan Clean Architecture di A...
DicodingEvent
 
Learning Patterns Lydia Hallie Addy Osmani Josh W Comeau
fatolukaman
 
The dependency inversion principle
navicorevn
 
Software Architecture Erosion and Modernization
bmerkle
 
Javascript spaghetti stirtrek_5_17
Jared Faris
 
Lezione 03 Introduzione a react
University of Catania
 
Micro-Frontends JSVidCon
Amir Zuker
 
Lunch and learn as3_frameworks
Yuri Visser
 
"Write once, run everywhere", Oleksii Levzhynskyi
Fwdays
 
SOLID Design Principles
Samuel Breed
 
DevSecCon SG 2018 Fabian Presentation Slides
Fab L
 
The State of Wicket
Martijn Dashorst
 
235042632 super-shop-ee
homeworkping3
 
Git & dev ops come together, right now!
rhirschfeld
 
Typescript design patterns applied to sharepoint framework - Sharepoint Satur...
Luis Valencia
 
Fewd week4 slides
William Myers
 
CLR_via_CSharp_(Jeffrey_Richter_4th_Edition).pdf
ssuserbe139c
 
Ad

More from Anna Shymchenko (20)

PPTX
Константин Маркович: "Creating modular application using Spring Boot "
Anna Shymchenko
 
PPTX
Евгений Бова: "Modularity in Java: introduction to Jigsaw through the prism o...
Anna Shymchenko
 
PPTX
Евгений Руднев: "Programmers Approach to Error Handling"
Anna Shymchenko
 
PPTX
Александр Куцан: "Static Code Analysis in C++"
Anna Shymchenko
 
PPTX
Алесей Решта: “Robotics Sport & Luxoft Open Robotics Club”
Anna Shymchenko
 
PPTX
Орхан Гасимов: "Reactive Applications in Java with Akka"
Anna Shymchenko
 
PPTX
Евгений Хыст: "Server-Side Geo-Clustering Based on Geohash"
Anna Shymchenko
 
PPTX
Денис Прокопюк: “JMX in Java EE applications”
Anna Shymchenko
 
PDF
Роман Яворский "Introduction to DevOps"
Anna Shymchenko
 
PDF
Максим Сабарня “NoSQL: Not only SQL in developer’s life”
Anna Shymchenko
 
PDF
Андрей Лисниченко "SQL Injection"
Anna Shymchenko
 
PPTX
Светлана Мухина "Metrics on agile projects"
Anna Shymchenko
 
PPTX
Андрей Слободяник "Test driven development using mockito"
Anna Shymchenko
 
PPTX
Евгений Хыст "Application performance database related problems"
Anna Shymchenko
 
PPTX
Даурен Муса “IBM WebSphere - expensive but effective”
Anna Shymchenko
 
PPTX
Александр Пашинский "Reinventing Design Patterns with Java 8"
Anna Shymchenko
 
PPTX
Евгений Капинос "Advanced JPA (Java Persistent API)"
Anna Shymchenko
 
PPTX
Event-driven architecture with Java technology stack
Anna Shymchenko
 
PPTX
Guava - Elements of Functional Programming
Anna Shymchenko
 
PDF
Максим Сабарня и Иван Дрижирук “Vert.x – tool-kit for building reactive app...
Anna Shymchenko
 
Константин Маркович: "Creating modular application using Spring Boot "
Anna Shymchenko
 
Евгений Бова: "Modularity in Java: introduction to Jigsaw through the prism o...
Anna Shymchenko
 
Евгений Руднев: "Programmers Approach to Error Handling"
Anna Shymchenko
 
Александр Куцан: "Static Code Analysis in C++"
Anna Shymchenko
 
Алесей Решта: “Robotics Sport & Luxoft Open Robotics Club”
Anna Shymchenko
 
Орхан Гасимов: "Reactive Applications in Java with Akka"
Anna Shymchenko
 
Евгений Хыст: "Server-Side Geo-Clustering Based on Geohash"
Anna Shymchenko
 
Денис Прокопюк: “JMX in Java EE applications”
Anna Shymchenko
 
Роман Яворский "Introduction to DevOps"
Anna Shymchenko
 
Максим Сабарня “NoSQL: Not only SQL in developer’s life”
Anna Shymchenko
 
Андрей Лисниченко "SQL Injection"
Anna Shymchenko
 
Светлана Мухина "Metrics on agile projects"
Anna Shymchenko
 
Андрей Слободяник "Test driven development using mockito"
Anna Shymchenko
 
Евгений Хыст "Application performance database related problems"
Anna Shymchenko
 
Даурен Муса “IBM WebSphere - expensive but effective”
Anna Shymchenko
 
Александр Пашинский "Reinventing Design Patterns with Java 8"
Anna Shymchenko
 
Евгений Капинос "Advanced JPA (Java Persistent API)"
Anna Shymchenko
 
Event-driven architecture with Java technology stack
Anna Shymchenko
 
Guava - Elements of Functional Programming
Anna Shymchenko
 
Максим Сабарня и Иван Дрижирук “Vert.x – tool-kit for building reactive app...
Anna Shymchenko
 

Recently uploaded (20)

PPTX
Employee salary prediction using Machine learning Project template.ppt
bhanuk27082004
 
PDF
Virtual Threads in Java: A New Dimension of Scalability and Performance
Tier1 app
 
PDF
SAP GUI Installation Guide for Windows | Step-by-Step Setup for SAP Access
SAP Vista, an A L T Z E N Company
 
PDF
Generating Union types w/ Static Analysis
K. Matthew Dupree
 
PPTX
ASSIGNMENT_1[1][1][1][1][1] (1) variables.pptx
kr2589474
 
PDF
Summary Of Odoo 18.1 to 18.4 : The Way For Odoo 19
CandidRoot Solutions Private Limited
 
PDF
AI Image Enhancer: Revolutionizing Visual Quality”
docmasoom
 
PDF
How to Download and Install ADT (ABAP Development Tools) for Eclipse IDE | SA...
SAP Vista, an A L T Z E N Company
 
PDF
Enhancing Healthcare RPM Platforms with Contextual AI Integration
Cadabra Studio
 
PPTX
Contractor Management Platform and Software Solution for Compliance
SHEQ Network Limited
 
PDF
10 posting ideas for community engagement with AI prompts
Pankaj Taneja
 
PDF
Troubleshooting Virtual Threads in Java!
Tier1 app
 
PPTX
Role Of Python In Programing Language.pptx
jaykoshti048
 
PDF
advancepresentationskillshdhdhhdhdhdhhfhf
jasmenrojas249
 
PDF
What companies do with Pharo (ESUG 2025)
ESUG
 
PPTX
slidesgo-unlocking-the-code-the-dynamic-dance-of-variables-and-constants-2024...
kr2589474
 
PDF
Enhancing Security in VAST: Towards Static Vulnerability Scanning
ESUG
 
PDF
Why Are More Businesses Choosing Partners Over Freelancers for Salesforce.pdf
Cymetrix Software
 
PDF
New Download FL Studio Crack Full Version [Latest 2025]
imang66g
 
PPT
Brief History of Python by Learning Python in three hours
adanechb21
 
Employee salary prediction using Machine learning Project template.ppt
bhanuk27082004
 
Virtual Threads in Java: A New Dimension of Scalability and Performance
Tier1 app
 
SAP GUI Installation Guide for Windows | Step-by-Step Setup for SAP Access
SAP Vista, an A L T Z E N Company
 
Generating Union types w/ Static Analysis
K. Matthew Dupree
 
ASSIGNMENT_1[1][1][1][1][1] (1) variables.pptx
kr2589474
 
Summary Of Odoo 18.1 to 18.4 : The Way For Odoo 19
CandidRoot Solutions Private Limited
 
AI Image Enhancer: Revolutionizing Visual Quality”
docmasoom
 
How to Download and Install ADT (ABAP Development Tools) for Eclipse IDE | SA...
SAP Vista, an A L T Z E N Company
 
Enhancing Healthcare RPM Platforms with Contextual AI Integration
Cadabra Studio
 
Contractor Management Platform and Software Solution for Compliance
SHEQ Network Limited
 
10 posting ideas for community engagement with AI prompts
Pankaj Taneja
 
Troubleshooting Virtual Threads in Java!
Tier1 app
 
Role Of Python In Programing Language.pptx
jaykoshti048
 
advancepresentationskillshdhdhhdhdhdhhfhf
jasmenrojas249
 
What companies do with Pharo (ESUG 2025)
ESUG
 
slidesgo-unlocking-the-code-the-dynamic-dance-of-variables-and-constants-2024...
kr2589474
 
Enhancing Security in VAST: Towards Static Vulnerability Scanning
ESUG
 
Why Are More Businesses Choosing Partners Over Freelancers for Salesforce.pdf
Cymetrix Software
 
New Download FL Studio Crack Full Version [Latest 2025]
imang66g
 
Brief History of Python by Learning Python in three hours
adanechb21
 

Do we need SOLID principles during software development?

  • 1. www.luxoft.com Do we need SOLID principles during software development? Luxoft Kiev 29.10.2015 Kseniya Shaposhnikova
  • 2. www.luxoft.com Content  What are SOLID principles? Single Responsibility Open Close Liskov Substitution Interface Segregation Dependency Inversion  Project design issues  SOLID principles pros and cons
  • 3. www.luxoft.com What are SOLID principles? Object-oriented design principles that allow software engineers eliminate project issues by creating the best project based on existing properties.
  • 4. www.luxoft.com Project design issues Instability Immobility Viscosity Tightness Uncertainty Unjustified Repetitions Unjustified Complexity
  • 5. www.luxoft.com Single Responsibility Principle (SRP) There should be only one reason to change class
  • 8. www.luxoft.com Open Close Principle (OCP) Software objects (classes, modules, functions, etc.) should be open to extension but close to modifications.  Extension – addition of new behavior types (via abstractions)  Modification – changes in binary modules
  • 9. www.luxoft.com Strategy Pattern class Strategy «interface» EventHandler + processEvent(Event) : void Client - eventHandler: EventHandler DailyEventHandler + processEvent(Event) : void MonthlyEventHandler + processEvent(Event) : void
  • 10. www.luxoft.com Template Method Pattern class Template Method ReportGenerator + generateReport() : void + retrieveData() : void + validateData() : void + createReport() : void Client - reportGenerator: ReportGenerator WeeklyReportGenerator + retrieveData() : void + validateData() : void + createReport() : void QuaterlyReportGenerator + retrieveData() : void + validateData() : void + createReport() : void Report generatorReport(){ Data data retrieveData(); boolean isValid=validateData(data); if (isValid){ return createReport(data); } ... }
  • 11. www.luxoft.com Liskov Substitution Principle (LSP) Subtypes must be able to be replaced by base types.
  • 13. www.luxoft.com Interface Segregation Principle (ISP) Clients should not become dependent on methods which they do not need.
  • 14. www.luxoft.com Interface Segregation Principle Wrong class Interface Segregation «interface» ITextEditor + printContent() : void + saveContent() : void + copyText() : void + pasteText() : void DesktopEditor + printContent() : void + saveContent() : void + copyText() : void + pasteText() : void OnlineEditor + printContent() : void + saveContent() : void + copyText() : void + pasteText() : void CommandLineEditor + printContent() : void + saveContent() : void + copyText() : void + pasteText() : void
  • 15. www.luxoft.com Interface Segregation Principle Right class Interface Segregation «interface» UITextEditor + copyText() : void + pasteText() : void «interface» BaseTextEditor + printContent() : void + saveContent() : void DesktopEditor + copyText() : void + printContent() : void + pasteText() : void + saveContent() : void OnlineEditor + copyText() : void + printContent() : void + pasteText() : void + saveContent() : void CommandLineEditor + printContent() : void + saveContent() : void
  • 16. www.luxoft.com Dependency Inversion Principle (DIP)  High-level modules should not depend from low-level modules. Both module types should depend on abstractions.  Abstractions should not depend on details. Details should depend on abstractions.
  • 17. www.luxoft.com Dependency Inversion Principle Wrong class Dependency Inversion BookingService + addBooking() : void ClientsStorage + getClient() : Client DiscountCalculator + calculateDiscount(Client) : double
  • 18. www.luxoft.com Dependency Inversion Principle Right class Dependency Inversion BookingService + addBooking() : void «interface» IDiscountCalculator + getDiscount(Client) : int «interface» IClientsStorage + getClient() : Client ClientsCatalog + getClient() : Client BasicDiscountCalculator + getDiscount(Client) : int
  • 19. www.luxoft.com Benefits of SOLID principles  Changes in different parts of system do not affect unrelated parts.  System is flexible for potential changes due to various abstractions.  Each part of system can use only those set of exposed that it needs from interfaces.  No need to implement unnecessary methods.  Changes in details do not affect high-level abstractions.
  • 20. www.luxoft.com Too many small code modules each having single responsibility.  Hard to make changes in modules because it is difficult to predict which other parts use this small module.  It’s hard to explore code dependencies because of large number of modules.
  • 21. www.luxoft.com Too many abstractions.  Create tests on early stages of development.  Make development cycles short .  Show results regularly to predict possible changes.
  • 22. www.luxoft.com Too many interfaces.  According to DIP we have to use references to interfaces instead of references to implementations.  Do not invert dependencies for classes that remain unchanged.
  • 23. www.luxoft.com We have to think over correct invariants on early stages.  Class invariant is an invariant used to constrain objects of a class.  The class invariant constrains the state stored in the object.  Programming by contract can be used.
  • 24. www.luxoft.com  We segregate interfaces and have several ones instead of one.  We have to hold all those references in class that consumes interfaces.  Logically group interface methods but do not split them too much if it really is not needed in your concrete code. We have to hold references to several interfaces.
  • 25. www.luxoft.com What did we talk about?  Each SOLID principle described  What issues SOLID principles allow to solve  Pros and cons of each one

Editor's Notes

  • #26: Отвечая на главный вопрос «Нужны ли СОЛИД принципы при разработке программного обеспечения» можно сказать, что они действительно нужны, поскольку они являются фундаментальными для объектно-ориентированного проектирования. Но пытаясь избежать чрезмерной сложности, неподвижности, неустойчивости, можно вернуться к тому, от чего пытались уйти, но уже в другом проявлении. Поэтому разработка - это постоянный поиск компромиссов - между эфективностью, прозводительность, гибкостью. И важно соблюдать необходимый баланс. То есть сделать приложение таким, чтобы оно не было переполнено ненужными уровнями абстракций, но в то же время было качественным и соответствовало требованиям.