Reputation: 53263
Is there any commonly referred methodology or a kind of design-pattern or a model when it comes to delete a record from user interface which exists in a database?
Basically what following steps should be taken and when (like validation, deleting the main record, how to handle when there is a
Conflict with the REFERENCE constraint
How to handle exceptions or notifying user on a failure (how to transfer the BL failure info to the UI; by catching exceptions or some report object etc.) and more or less the most common issues regarding to the deletion context.
Upvotes: 1
Views: 403
Reputation: 31630
For database issues like you describe, consider a centralized exception management strategy so that exceptions are caught and thrown consistently in you data layer. You should:
Upvotes: 0
Reputation: 1955
Upvotes: 1
Reputation: 3777
First things first i think you need to separate your DataLayer from the actual back end data store. you could NHibernate or Microsoft's Entity Framework to make ORM (Object Relational Mapping) easier. So that your data your show in your GUI represents object which represents data in the DB.
you could use MS Entreprise Libraries Validation block to the validation.
Also depends if you are using Winforms or WPF. you have to make sure some sort of Service/Model is handling all the CRUD ops and not the GUI so that you can test the updating bit with unit tests
Upvotes: 0
Reputation: 13057
When you delete a record, you can do a few things:
What are you using for your business layer, and what API's are you using to retreive and store data in your code?
Upvotes: 0