Posts Tagged ‘dziedziczenie’

Zastąp ify przez polimorfizm

Niecały rok temu pisałem o prezentacji Tomasza Nurkiewicza pt. Uwolnić się od ifów.

Istotnie, wiele instrukcji warunkowych w kodzie utrudnia jego zrozumienie, testowanie i utrzymanie. Często w takiej sytuacji łamany jest Single Responsibility Principle.
Read the rest of this entry »

Dziedziczenie a podtypy

A distinction between inheritance and subtyping is not often made: classes are often equated directly with types.
From a behavioural point of view a type defines characteristics and a class defines an implementation of these characteristics.

Kevlin Henney
Distributed Object-Oriented Computing:
The Development and Implementation of an Abstract Machine