SlideShare a Scribd company logo
1 of 15
SHOOTING AT A MOVING
TARGET
Software development is …
İrem Küçükali
• Requirements change.
• Software should be designed iteratively. Each iteration aims to
improve the design for it to be as good as it can be for the current
situation of the system.
• Being agile leads keeping design flexible and easy to change.
• Never let the rot begin.
Clues of Rotting Software
• Rigidity: Don’t write everyting in one place & use abstractions
• Fragility: Ex. callback hells
• Immobility: Don’t write intricate code
• Viscosity: Preserving the design is hard.
• Needless Complexity: Weight of unused design.
• Needless Repetition: Don’t copy-paste the same code over and over.
• Opacity: Difficult to understand
And How To Avoid Them
• Rigidity
• Fragility
• Immobility
• Viscosity
• Needless Complexity
• Needless Repetition
• Opacity
• S ingle Responsibility
• O pen Closed
• L iskov Substitution
• I nterface Segregation
• D ependency Inversion
PRINCIPLES
Single Responsibility Principle
• A class should have only one reason to change.
• Having multiple responsibility on a class may cause rebuild, retest and
redeploy all dependent applications just because one of them needed
to change.
Open Closed Principle
• Extendible without modifying
• Uses abstract classes and derivatives to extend
• Avoids recompilation
• Avoids Fragility by saving us from countless if/else statements
• Avoids Rigidity since there would be no need for changes in existing
modules.
• Avoids Immobility by creating seperable modules not affected by
changes in each other
• Abstractions can save us from changes (only) that we anticipated.
Open Closed Principle
• Not complete, but strategic closure.
• Strategic: experiences, educated guesses
• Applying OCP, only for likely changes.
• Wait until need abstraction.
• Flexible, reusable, maintainable.
To See Earlier The Changes That Are Likely
• Write tests first.
• Release early and often.
Liskov Substitution Principle
• Subtypes must be substitutiable for their base types.
• Violated by fragile functions with respect to classes with IS-A hierarchy
• IS-A relationship concerns behaviour
• Validity can only be expressed in terms of clients.
• Design by Contract:
• Base class > Derived class
• Unit tests indicate contracts
• To avoid LSP violation, superclasses representing the classes with IS-A
relationship may be used
• Set of classes sharing same responsibility should inherit it from a superclass
• In that way, it would be easier to add a new subclass sharing same responsibility.
Liskov Substitution Principle
• LSP makes OCP possible.
• IS-A does not mean subtype.
Clues about LSP Violations
• Derivative doing less than its base class is usually violates LSP.
• Derivative throwing an exception whose base don’t throw them is
another form of violation.
Dependency Inversion Principle
• To be mobile/reusable and flexible, high-level modules should depend on
abstraction(interfaces) instead of low-level modules.
• Changes to lower-level modules cannot affect and change high-level
modules
• Services through a well-designed and controlled interface
• Lower layers depend on abstract service interfaces declared in upper layers
• Depending on abstractions
• No reference to concrete classes
• No derivative of concrete classes
• No overriding implemented methods of base classes
Dependency Inversion Principle
• Seperating policy from implementation
• Nobody owns the interface
Interface Segregation Principle
• Interface pollution: When derivatives needs a new method, that
method will be added to the base class
• Multiple inheritance can be used to conform ISP
• Using same object through seperate inte
References Next…

More Related Content

Similar to Shooting at a Moving Target

Software Design Principles (SOLID)
Software Design Principles (SOLID)Software Design Principles (SOLID)
Software Design Principles (SOLID)ASIMYILDIZ
 
Improving Software Quality Using Object Oriented Design Principles
Improving Software Quality Using Object Oriented Design PrinciplesImproving Software Quality Using Object Oriented Design Principles
Improving Software Quality Using Object Oriented Design PrinciplesDr. Syed Hassan Amin
 
2009 training - tim m - object oriented programming
2009   training - tim m - object oriented programming2009   training - tim m - object oriented programming
2009 training - tim m - object oriented programmingTim Mahy
 
Apply SOLID Design principles to javascript code with immediate function invo...
Apply SOLID Design principles to javascript code with immediate function invo...Apply SOLID Design principles to javascript code with immediate function invo...
Apply SOLID Design principles to javascript code with immediate function invo...Anuradha Bandara
 
Software design principles
Software design principlesSoftware design principles
Software design principlesMd.Mojibul Hoque
 
Working With Concurrency In Java 8
Working With Concurrency In Java 8Working With Concurrency In Java 8
Working With Concurrency In Java 8Heartin Jacob
 
Object Oriented Programming Ch3 SRP, DIP, ISP
Object Oriented Programming Ch3 SRP, DIP, ISPObject Oriented Programming Ch3 SRP, DIP, ISP
Object Oriented Programming Ch3 SRP, DIP, ISPChihyang Li
 
Things Every Professional Programmer Should Know
Things Every Professional Programmer Should KnowThings Every Professional Programmer Should Know
Things Every Professional Programmer Should KnowDaniel Sawano
 
Architecture Principles CodeStock
Architecture Principles CodeStock Architecture Principles CodeStock
Architecture Principles CodeStock Steve Barbour
 
Mock Objects, Design and Dependency Inversion Principle
Mock Objects, Design and Dependency Inversion PrincipleMock Objects, Design and Dependency Inversion Principle
Mock Objects, Design and Dependency Inversion PrincipleP Heinonen
 
RSpec & Rails, an introduction
RSpec & Rails, an introductionRSpec & Rails, an introduction
RSpec & Rails, an introductionUtku Kaynar
 
Software Design Principles
Software Design PrinciplesSoftware Design Principles
Software Design PrinciplesOcean Dong
 
Clean code: SOLID (iOS)
Clean code: SOLID (iOS)Clean code: SOLID (iOS)
Clean code: SOLID (iOS)Maksym Husar
 

Similar to Shooting at a Moving Target (20)

Software Design Principles (SOLID)
Software Design Principles (SOLID)Software Design Principles (SOLID)
Software Design Principles (SOLID)
 
Improving Software Quality Using Object Oriented Design Principles
Improving Software Quality Using Object Oriented Design PrinciplesImproving Software Quality Using Object Oriented Design Principles
Improving Software Quality Using Object Oriented Design Principles
 
Solid principles
Solid principlesSolid principles
Solid principles
 
android principle.pptx
android principle.pptxandroid principle.pptx
android principle.pptx
 
2009 training - tim m - object oriented programming
2009   training - tim m - object oriented programming2009   training - tim m - object oriented programming
2009 training - tim m - object oriented programming
 
SOLID Principles
SOLID PrinciplesSOLID Principles
SOLID Principles
 
Apply SOLID Design principles to javascript code with immediate function invo...
Apply SOLID Design principles to javascript code with immediate function invo...Apply SOLID Design principles to javascript code with immediate function invo...
Apply SOLID Design principles to javascript code with immediate function invo...
 
Software design principles
Software design principlesSoftware design principles
Software design principles
 
Working With Concurrency In Java 8
Working With Concurrency In Java 8Working With Concurrency In Java 8
Working With Concurrency In Java 8
 
Object Oriented Programming Ch3 SRP, DIP, ISP
Object Oriented Programming Ch3 SRP, DIP, ISPObject Oriented Programming Ch3 SRP, DIP, ISP
Object Oriented Programming Ch3 SRP, DIP, ISP
 
OOP in JS
OOP in JSOOP in JS
OOP in JS
 
Things Every Professional Programmer Should Know
Things Every Professional Programmer Should KnowThings Every Professional Programmer Should Know
Things Every Professional Programmer Should Know
 
S.O.L.I.D xp
S.O.L.I.D xpS.O.L.I.D xp
S.O.L.I.D xp
 
Writing S.O.L.I.D Code
Writing S.O.L.I.D CodeWriting S.O.L.I.D Code
Writing S.O.L.I.D Code
 
Architecture Principles CodeStock
Architecture Principles CodeStock Architecture Principles CodeStock
Architecture Principles CodeStock
 
Mock Objects, Design and Dependency Inversion Principle
Mock Objects, Design and Dependency Inversion PrincipleMock Objects, Design and Dependency Inversion Principle
Mock Objects, Design and Dependency Inversion Principle
 
RSpec & Rails, an introduction
RSpec & Rails, an introductionRSpec & Rails, an introduction
RSpec & Rails, an introduction
 
Software Design Principles
Software Design PrinciplesSoftware Design Principles
Software Design Principles
 
Clean code: SOLID (iOS)
Clean code: SOLID (iOS)Clean code: SOLID (iOS)
Clean code: SOLID (iOS)
 
Clean code: SOLID
Clean code: SOLIDClean code: SOLID
Clean code: SOLID
 

Recently uploaded

(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
Analog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAnalog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAbhinavSharma374939
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSCAESB
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations120cr0395
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 

Recently uploaded (20)

(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
Analog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAnalog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog Converter
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentation
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 

Shooting at a Moving Target

  • 1. SHOOTING AT A MOVING TARGET Software development is … İrem Küçükali
  • 2. • Requirements change. • Software should be designed iteratively. Each iteration aims to improve the design for it to be as good as it can be for the current situation of the system. • Being agile leads keeping design flexible and easy to change. • Never let the rot begin.
  • 3. Clues of Rotting Software • Rigidity: Don’t write everyting in one place & use abstractions • Fragility: Ex. callback hells • Immobility: Don’t write intricate code • Viscosity: Preserving the design is hard. • Needless Complexity: Weight of unused design. • Needless Repetition: Don’t copy-paste the same code over and over. • Opacity: Difficult to understand
  • 4. And How To Avoid Them • Rigidity • Fragility • Immobility • Viscosity • Needless Complexity • Needless Repetition • Opacity • S ingle Responsibility • O pen Closed • L iskov Substitution • I nterface Segregation • D ependency Inversion PRINCIPLES
  • 5. Single Responsibility Principle • A class should have only one reason to change. • Having multiple responsibility on a class may cause rebuild, retest and redeploy all dependent applications just because one of them needed to change.
  • 6. Open Closed Principle • Extendible without modifying • Uses abstract classes and derivatives to extend • Avoids recompilation • Avoids Fragility by saving us from countless if/else statements • Avoids Rigidity since there would be no need for changes in existing modules. • Avoids Immobility by creating seperable modules not affected by changes in each other • Abstractions can save us from changes (only) that we anticipated.
  • 7. Open Closed Principle • Not complete, but strategic closure. • Strategic: experiences, educated guesses • Applying OCP, only for likely changes. • Wait until need abstraction. • Flexible, reusable, maintainable.
  • 8. To See Earlier The Changes That Are Likely • Write tests first. • Release early and often.
  • 9. Liskov Substitution Principle • Subtypes must be substitutiable for their base types. • Violated by fragile functions with respect to classes with IS-A hierarchy • IS-A relationship concerns behaviour • Validity can only be expressed in terms of clients. • Design by Contract: • Base class > Derived class • Unit tests indicate contracts • To avoid LSP violation, superclasses representing the classes with IS-A relationship may be used • Set of classes sharing same responsibility should inherit it from a superclass • In that way, it would be easier to add a new subclass sharing same responsibility.
  • 10. Liskov Substitution Principle • LSP makes OCP possible. • IS-A does not mean subtype.
  • 11. Clues about LSP Violations • Derivative doing less than its base class is usually violates LSP. • Derivative throwing an exception whose base don’t throw them is another form of violation.
  • 12. Dependency Inversion Principle • To be mobile/reusable and flexible, high-level modules should depend on abstraction(interfaces) instead of low-level modules. • Changes to lower-level modules cannot affect and change high-level modules • Services through a well-designed and controlled interface • Lower layers depend on abstract service interfaces declared in upper layers • Depending on abstractions • No reference to concrete classes • No derivative of concrete classes • No overriding implemented methods of base classes
  • 13. Dependency Inversion Principle • Seperating policy from implementation • Nobody owns the interface
  • 14. Interface Segregation Principle • Interface pollution: When derivatives needs a new method, that method will be added to the base class • Multiple inheritance can be used to conform ISP • Using same object through seperate inte