Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interface Power #6

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Interface Power #6

wants to merge 9 commits into from

Conversation

FrostF0X
Copy link
Contributor

Chciałem o zupewnie inny napisać ale poleciałem...

Copy link
Contributor

@mlebkowski mlebkowski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good, ale generalnie wydaje mi się, że trochę rozmywa się co chcesz powiedzieć. Cała wstawka o Liskov mnie zaskoczyła… Nie do końca pokazujesz, że jesteś niezgodny z Liskov, a potem tłumaczysz na abstrakcyjnym przykładzie jak być zgodnym.

author: frost-fox
---

### Abstraction and polymorphism
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Zacznij z 2-go poziomu nagłówka


In object oriented programming such principles as Polymorphism and Abstraction are considered as golden rules, and we
all understand theoretical basis of this principles and their simplistic beauty. Abstraction allows us to create
functions defined as **abstract**, without specifying it's details at the beginning and deferring this moment to
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Chyba to zbyt szybki przeskok od „abstrakcji” do „abstrakcyjnej klasy / metody”…

```

By adding `getDescription` logic `WebPage` we have used **inheritance** concept in programming language, now every logic
introduced in parent class is inherited by it's child. Main point here is that we have tried to predict the future and
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

its

* Liskov Substitution Principle

### Cure
There is a way how you can reduce damage of Liskov in your code and completely omit inheritance chains and Parent and
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Liskov powoduje jakiś damage w Twoim kodzie?

```
This approach will leave abstraction and polymorphism to serve us, but will remove any inheritance.
What we can see here:
1) We cannot inherit undesirable logic and dependencies from `WebPage` class - it simply can't have logic.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To jest markdown? Nie jeśli nie, to użyj 1. itd

@mlebkowski
Copy link
Contributor

Piszesz tekst, a nie kod, edytor powinien za Ciebie zawijać linie:

@mlebkowski
Copy link
Contributor

Daj mu trochę przestrzeni:

@mlebkowski
Copy link
Contributor

Whitespace is important:

@mlebkowski
Copy link
Contributor

Powinno mieścić się na stronie, nie w edytorze:

@mlebkowski
Copy link
Contributor

tak przy okazji, warto oglądać finalny produkt. Które wygląda lepiej?

https://www.wikiwand.com/en/Zero-width_non-joiner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants