SOLID Software Principles with C#

482 views

Published on

A small talk I did on Solid Principles

Published in: Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
482
On SlideShare
0
From Embeds
0
Number of Embeds
8
Actions
Shares
0
Downloads
8
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

SOLID Software Principles with C#

  1. 1. SOLID Software Development Ken Burkhardt
  2. 2. What is SOLID? Single Responsibility Principle Open Closed Principle Liskov Substitution Principle Interface Segregation Principle Dependency Inversion Principle
  3. 3. Why SOLID? S.O.L.I.D. is a collection of best- practice, object-oriented design principles which can be applied to your design, allowing you to accomplish various desirable goals such as loose-coupling, higher maintainability
  4. 4. Single Responsibility Principle THERE SHOULD NEVER BE MORE THAN ONE REASON FOR A CLASS TO CHANGE.
  5. 5. Demo - Superclass
  6. 6. Open Closed Principle SOFTWARE ENTITIES SHOULD BE OPEN FOR EXTENSION BUT CLOSED FOR MODIFICATION
  7. 7. Demo – Add New Validator
  8. 8. Liskov Substitution Principle You should be able to use any derived class in place of a parent class and have it behave in the same manner without modification. It ensures that a derived class does not affect the behavior of the parent class, i.e. that a derived class must be substitutable for its base class.
  9. 9. Interface Segregation Principle CLIENTS SHOULD NOT BE FORCED TO DEPEND UPON INTERFACES THAT THEY DO NOT USE
  10. 10. Demo - Animals
  11. 11. Dependency Inversion Principle A. HIGH LEVEL MODULES SHOULD NOT DEPEND UPON LOW LEVEL MODULES. BOTH SHOULD DEPEND UPON ABSTRACTIONS B. ABSTRACTIONS SHOULD NOT DEPEND UPON DETAILS. DETAILS SHOULD DEPEND UPON ABSTRACTIONS
  12. 12. Bad designs and poor code is not good because it's hard to change. Bad designs are: - Rigid (change affects too many parts of the system) - Fragile (every change breaks something unexpected) - Immobile (impossible to reuse)
  13. 13. Demo - Interfaces

×