Re: Programming to an Interface



On 2006-05-17 08:55:51 -0500, ram@xxxxxxxxxxxxxxxxxx (Stefan Ram) said:


As an exercise of style, I asked myself: How could I remove
all dependencies on concrete types from the following
algorithm and express it using solely interfaces?

Entertaining.

My rule of thumb is that I feel very compfortable depending on a concrete class that is not going to change. String, for example, is not going to change very often; so I don't mind using it. On the other hand, the classes that I am in the midst of designing and building are changing all the time. So I often build interfaces for those classes to protect me from those changes.
--
Robert C. Martin (Uncle Bob)  | email: unclebob@xxxxxxxxxxxxxxxx
Object Mentor Inc.            | blog:  www.butunclebob.com
The Agile Transition Experts  | web:   www.objectmentor.com
800-338-6716                  |



.