2

Models in an MVC application gets kind of hard to test when validation of data and persistence of data is baked together in the model. I would like to test those separately to prevent doing integration testing instead of actual unit testing.

What patterns are available to keep validation and persistence separated?

1

You may want to take a look at the persistance and validation mechanisms used by the Eclipse Modeling Framework (EMF). Model persistance and validation are fully separated concerns, and there is good support for plugging in your own custom validation code.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.