Browsed by
Category: Anti patterns

Anti-Pattern ‘Validation by Execute ‘n’ Rollback’

Anti-Pattern ‘Validation by Execute ‘n’ Rollback’

Recently in some reviews I saw an anti-pattern. First you have to know, in the code, there was a validation of the data before it was stored in the database. So far so good. But when I looked at the validation code, I saw the following: public void Validate() { DoProcess(true); } And the persist logic (with some business logic) looked like this: public void Process() { DoProcess(false); } So, I asked myself, what the Boolean means. Well, here is…

Read More Read More