Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

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?

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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