Design Pattern for Data Validation
Posted
by
melodui
on Programmers
See other posts from Programmers
or by melodui
Published on 2014-04-03T03:50:32Z
Indexed on
2014/06/02
9:50 UTC
Read the original article
Hit count: 177
design-patterns
What would be the best design pattern for this problem:
I have an Object A. Object A can either be registered or deleted from the database depending on the user request.
Data validation is performed before registration or deletion of the object. There are a set of rules to be checked before the object can be registered and another set of rules for deletion. Some of these rules are common for both operations.
So far, I think the Chain of Responsibility design pattern fits the most but I'm having trouble implementing it.
© Programmers or respective owner