Ad
  • Custom User Avatar

    It's not about property, but expected behaviour of subclass. One could (reasonably) expect that object of human subclasses will have existing parents, since we force human creation polity that way. After all, if we consider this as part of larger piece of software, all humans can be used in different ways. Since they expose Mother/Father properties, these properties may be used. At one point Adam or Eve object may be used in a manner that do not indicate their unnatural properties, which can led to inconsistency. If they are created just for the sake of ie. being parents to the other humans, and then kept aside, this is fine tho.

  • Custom User Avatar

    Could you elaborate? Which property of the class Human is violated by its subclasses?
    That every human has a non-null father and mother is IMHO not a property of the class Human in this kata.

  • Custom User Avatar

    I have a feeling that this kata violates somehow Liskov' Substitution Principle, namely when we expect every human to be produced by father and mother, which implies that every human has parents, but then we ie. assign adam instance to Male and bum - it's null, wtf. I do understand it shows type hierarchy, but imho proper OOP requires also that subclasses do not violate parent class behaviour.