Mock objects transparently-substitutable mock-ups of objects used in testing are a powerful mechanism for testing what can otherwise be intractable systems (think about testing code that uses external sensors or relational databases).
Perl has strong support for mock objects (witness my
Test::MockDBI),
but that is not true of all languages. This was brought to my attention when I tried and failed to find a usable mock object framework for either VB6 or the
IMHO, interfaces should be required only when two or more classes need to exhibit the same behaviors (like IO::File and IO::String do in common cases). Classes that need only one kind of behavior should not be required to have interfaces. Even
VB6 has reached the end of its development and free-support lifecycle. The
P.S. Language is funny; mocking objects would be like, "Your accessors look weird," or "Constructors? *Those* are a pathetic excuse!")
P.P.S. FWIW,
L# is a LISP for
Amen. (Score:1)