SOLID Software Principles with C#

kenburkhardt714 787 views 19 slides Jul 18, 2014
Slide 1
Slide 1 of 19
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19

About This Presentation

A small talk I did on Solid Principles


Slide Content

SOLID Software Development Ken Burkhardt

What is SOLID? Single Responsibility Principle Open Closed Principle Liskov Substitution Principle Interface Segregation Principle Dependency Inversion Principle

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

Single Responsibility Principle THERE SHOULD NEVER BE MORE THAN ONE REASON FOR A CLASS TO CHANGE.

Demo - Superclass

Open Closed Principle SOFTWARE ENTITIES SHOULD BE OPEN FOR EXTENSION BUT CLOSED FOR MODIFICATION

Demo – Add New Validator

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.

Interface Segregation Principle CLIENTS SHOULD NOT BE FORCED TO DEPEND UPON INTERFACES THAT THEY DO NOT USE

Demo - Animals

Dependency Inversion Principle 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

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)

Demo - Interfaces
Tags