Tag Archives: OOP

Divide-and-Conquer: Coping with Complexity

Sometimes a problem is simply too complex for us to solve. Our only chance seems to be breaking it into smaller parts that we know how to deal with. This strategy of reducing the complexity of a problem by dividing … Continue reading

Posted in OOD, OOP | Tagged , | 2 Comments

Inheritance and the Power of Abstraction

Programming is an exercise in abstraction. If a program is intended to solve some problem, we must first be able to model this problem in an abstract way, in order to express it in a programming language. Only after the … Continue reading

Posted in OOD, OOP | Tagged , | 3 Comments

The Liskov Substitution Principle and Test-Driven Development

The Substitution Principle, first defined by Barbara Liskov, says that: “Let q(x) be a property provable about objects x of type T. Then q(y) should be true for objects y of type S where S is a subtype of T.” … Continue reading

Posted in OOD, OOP, TDD | Tagged , , | 3 Comments

When a square is not a rectangle

In my previous post, I’ve used the example of squares and rectangles to illustrate the importance of definitions. It is clear that, from a geometric point-of-view, a square is indeed a kind of rectangle. However, as my friend Arnon has … Continue reading

Posted in OOD, OOP | Tagged , | 4 Comments