To interface or not to interface

Bruno Medeiros brunodomedeiros+spam at
Wed May 26 06:55:52 PDT 2010

On 24/05/2010 22:14, Marianne Gagnon wrote:
> In my experience (not related to DCollections), having interfaces is useful to ensure reduced coupling, thus enabling the use of mock classes for unit tests (or simply to test your module, when your module needs to use services provided by another module that is being written by a colleague but not yet usable, etc...)

That's generally true, but I don't think it applies to DCollections. 
Creating mock objects is for mocking complex subsystems and modules, 
such that setting up (and later verifying) the mock object is much 
easier than if the true object/subsystem was used. But that would not 
apply to a collection object, since a mock collection would not really 
be easier to work with than with the real collection object.

Bruno Medeiros - Software Engineer

More information about the Digitalmars-d mailing list