Skip to main content
quote from the referenced link
Source Link
gnat
  • 20.5k
  • 29
  • 117
  • 310

The model should not depend on a (concrete) DB. If it only knows an abstract DB (read "interface") which is handed to the model then you can replace the DB with a mock (http://en.wikipedia.org/wiki/Mock_objectmock object).

In object-oriented programming, mock objects are simulated objects that mimic the behavior of real objects in controlled ways. A programmer typically creates a mock object to test the behavior of some other object, in much the same way that a car designer uses a crash test dummy to simulate the dynamic behavior of a human in vehicle impacts...

The model should not depend on a (concrete) DB. If it only knows an abstract DB (read "interface") which is handed to the model then you can replace the DB with a mock (http://en.wikipedia.org/wiki/Mock_object).

The model should not depend on a (concrete) DB. If it only knows an abstract DB (read "interface") which is handed to the model then you can replace the DB with a mock object.

In object-oriented programming, mock objects are simulated objects that mimic the behavior of real objects in controlled ways. A programmer typically creates a mock object to test the behavior of some other object, in much the same way that a car designer uses a crash test dummy to simulate the dynamic behavior of a human in vehicle impacts...

Source Link
EricSchaefer
  • 2.1k
  • 1
  • 18
  • 31

The model should not depend on a (concrete) DB. If it only knows an abstract DB (read "interface") which is handed to the model then you can replace the DB with a mock (http://en.wikipedia.org/wiki/Mock_object).