Information générale
Catégorie:
Programmation Orientée Object
Titre:
N-tier: Where to place cascading delete?
Looking for general ideas in where to place the
coding for cascading deletes (and other pieces
of code like this). No DRI stuff should be used,
only triggers.
Why do I ask? I am reading more and more not
to place code in the database itself for n-tier
applications. I write multi-tier applications,
but I am getting a little mixed-up with all
the articles I am reading. It is sounding more
and more like nothing belongs in the database
except the data in the tables.
The outline I use:
Tier Serperate User Front-End
- Only basic error checking
Tier Seperate Business Rules
- Returns true/false (error messasges)
to front-end if rule violated.
- Orphans
- Required fields
- Translation of lookup fields
- Amount between ...
- Dates between ...
- etc.
- Pass data to next outline
Tier Save\Retreive data only.
- No error checking.
Tier The database itself.
- Obviously holds the data tables
- Cascading deletes.
- Certain no-no's enforced.
- i.e. Orphans
- Required fields.
I realize certain things are repeated between
the Business Rules and the database trigger rules.
Assume there is no data entry directly into the
tables (i.e. browse windows). Assume this is
for client-server (MS SQL Server or Oracle).
So ... where does the cascading delete go
(assuming it is written by code) since spanning
databases can be a problem.
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement