Applying S.O.L.I.D. Principles in .NET C#

By: chr1skol1

54   0   4287

Uploaded on 12/24/2014

If you never heard of the S.O.L.I.D. principles you should see this video to develop better C# code. A 'must' for every professional developer.

Comments (1):

By splittingTimes    2019-08-12

Well it would have been nice if he stated his interpretation of the Liskov Substitution Principle. The way i understood it best was here [1].

A subclass should behave in a way that it never cause problems when it is used instead of the base class.

In concrete terms:

* No new exceptions are allowed to be thrown, unless they are subtypes of the exception thrown by the base class

* Preconditions cannot be strengthend by the subtype

* Postconditions cannot be weakened by the subtype

For me it is really the focus of using inheritance only if you want substitutability. Otherwise go with composition.

=== [1] https://youtu.be/8ZJ8BVlDIQ4?t=1762

Original Thread

Popular Videos 145694