Download - SOLID Software Principles with C#
![Page 1: SOLID Software Principles with C#](https://reader035.vdocuments.us/reader035/viewer/2022081516/5591a0c81a28aba7268b4662/html5/thumbnails/1.jpg)
SOLID Software Development
Ken Burkhardt
![Page 2: SOLID Software Principles with C#](https://reader035.vdocuments.us/reader035/viewer/2022081516/5591a0c81a28aba7268b4662/html5/thumbnails/2.jpg)
![Page 3: SOLID Software Principles with C#](https://reader035.vdocuments.us/reader035/viewer/2022081516/5591a0c81a28aba7268b4662/html5/thumbnails/3.jpg)
What is SOLID?
Single Responsibility Principle Open Closed Principle
Liskov Substitution PrincipleInterface Segregation PrincipleDependency Inversion Principle
![Page 4: SOLID Software Principles with C#](https://reader035.vdocuments.us/reader035/viewer/2022081516/5591a0c81a28aba7268b4662/html5/thumbnails/4.jpg)
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
![Page 5: SOLID Software Principles with C#](https://reader035.vdocuments.us/reader035/viewer/2022081516/5591a0c81a28aba7268b4662/html5/thumbnails/5.jpg)
Single Responsibility Principle
THERE SHOULD NEVER BE MORE THAN ONE REASON FOR A CLASS TO
CHANGE.
![Page 6: SOLID Software Principles with C#](https://reader035.vdocuments.us/reader035/viewer/2022081516/5591a0c81a28aba7268b4662/html5/thumbnails/6.jpg)
![Page 7: SOLID Software Principles with C#](https://reader035.vdocuments.us/reader035/viewer/2022081516/5591a0c81a28aba7268b4662/html5/thumbnails/7.jpg)
Demo - Superclass
![Page 8: SOLID Software Principles with C#](https://reader035.vdocuments.us/reader035/viewer/2022081516/5591a0c81a28aba7268b4662/html5/thumbnails/8.jpg)
Open Closed Principle
SOFTWARE ENTITIES SHOULD BE OPEN FOR EXTENSION BUT CLOSED
FOR MODIFICATION
![Page 9: SOLID Software Principles with C#](https://reader035.vdocuments.us/reader035/viewer/2022081516/5591a0c81a28aba7268b4662/html5/thumbnails/9.jpg)
![Page 10: SOLID Software Principles with C#](https://reader035.vdocuments.us/reader035/viewer/2022081516/5591a0c81a28aba7268b4662/html5/thumbnails/10.jpg)
Demo – Add New Validator
![Page 11: SOLID Software Principles with C#](https://reader035.vdocuments.us/reader035/viewer/2022081516/5591a0c81a28aba7268b4662/html5/thumbnails/11.jpg)
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.
![Page 12: SOLID Software Principles with C#](https://reader035.vdocuments.us/reader035/viewer/2022081516/5591a0c81a28aba7268b4662/html5/thumbnails/12.jpg)
![Page 13: SOLID Software Principles with C#](https://reader035.vdocuments.us/reader035/viewer/2022081516/5591a0c81a28aba7268b4662/html5/thumbnails/13.jpg)
Interface Segregation Principle
CLIENTS SHOULD NOT BE FORCED TO DEPEND UPON INTERFACES THAT
THEY DO NOT USE
![Page 14: SOLID Software Principles with C#](https://reader035.vdocuments.us/reader035/viewer/2022081516/5591a0c81a28aba7268b4662/html5/thumbnails/14.jpg)
![Page 15: SOLID Software Principles with C#](https://reader035.vdocuments.us/reader035/viewer/2022081516/5591a0c81a28aba7268b4662/html5/thumbnails/15.jpg)
Demo - Animals
![Page 16: SOLID Software Principles with C#](https://reader035.vdocuments.us/reader035/viewer/2022081516/5591a0c81a28aba7268b4662/html5/thumbnails/16.jpg)
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
![Page 17: SOLID Software Principles with C#](https://reader035.vdocuments.us/reader035/viewer/2022081516/5591a0c81a28aba7268b4662/html5/thumbnails/17.jpg)
![Page 18: SOLID Software Principles with C#](https://reader035.vdocuments.us/reader035/viewer/2022081516/5591a0c81a28aba7268b4662/html5/thumbnails/18.jpg)
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)
![Page 19: SOLID Software Principles with C#](https://reader035.vdocuments.us/reader035/viewer/2022081516/5591a0c81a28aba7268b4662/html5/thumbnails/19.jpg)
Demo - Interfaces