Liskov's Substitution Principle is the third of the five SOLID principles. The property is as follows :
Let
φ(x)
be a property provable about objectsx
of typeT
. Thenφ(y)
should also be true for objectsy
of typeS
whereS
is a subtype ofT
In simple words,
- Objects of a superclass should be able to be replaced with objects of a subclass without affecting the program.
- Object of subclass should be able to access the all the methods and properties of the superclass.
This project defines a Notifications Interface which have Send()
. Two classes inherited from above, namely EmailNotification
and SmsNotification
implement the functions.
The project builds and runs with Visual Studio Community 2022 when the required workloads are installed.