Liskov Substitution Principle ?(Php SOLID Principles)
Liskov Substitution Principle
~~~~~~~~~~~~~~~~~~~~
#Liskov's #substitution principle, is a software design principle most totable as the L in #SOLID design principles.
Liskov, references Barbara Liskov ~ the creator of the substitution principle.
In 1987, Barbara Liskov introduced a mathematical formula used to determine if a parent class and child class, or an abstract and an implementation are substitutable with each other.
Her mathematical formula is a specific implementation of what is
known as "String behavioral sub-typing".
A classes "behavior" is defined by its methods or functions.
A child class inherits its behavior from its parent class, making the child a sub-type of the parent class.
A child class can override inherited parent behavior with its own behavior.
This means a child can define its own function that differs from its parent function.
When a child overrides a parent function with its own behavior, we are no longer certain that the child and parent are substitutable with each other throughout the entirety of our application.
Liskov's Substitution principle defines a set of rules the child function can abide by when overriding parent behavior to insure that the parent and child are substitutable.
Here are the 5 rules a child must abide by to insure it is substitutable with its parent when overriding parent behavior (Based on the mathematical formula behind Liskov's substitution principle).
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5 Rules when overriding a method within a child class
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1. Child method arguments must match parent method arguments
2. Method return type must match parent return types.
3. pre-conditions of child function cannot be greater than pre-conditions of parent function
4. post-conditions of child function cannot be lesser than post-conditions of parent function
5. Any exceptions the child throws must be the same or a child of the same exception thrown in the parent function.
Dive in with me, as we go through the Liskov Substitution Principle ~ from a higher level and then directly within Php. #Php #SOLID #DesignPrinciples #LiskovSubstitutionPrinciple #LSP
Clean Code Studio ~ Simplify!
Clean Code Clean Life
https://cleancode.studio
https://cleancode.studio/series/solid-principles/episodes/3
Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «Liskov Substitution Principle ?(Php SOLID Principles)», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.
Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.
Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!
Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.