Business Process - Add Validation Unique
At the sample pattern in action. I conclude that the Business Layer has no relationship with Data Layer, but Data Layer who have a relation to Business Layer.
Then I want to ask, what if I want to add validation to a unique value in the Business Layer ?
Eric Santoso, Oct 19, 2015
A unique value can only be detected by querying the database. This means that you will have to do some hand coding.
In the UI you can use an Ajax call. In the application server (i.e."code behind') you can execute a database query. Finally in the database itself you probably have a unique constraint (unique index) on the particular value you are checking.
This duplication is the nature of validation if you want the user to have a great user-experience.
Hope this helps.
Jack Poorte, Nov 04, 2015