G
Guest
I'm having difficulty seeing how to effectively use ADO.NET's disconnected
datasets with n-tier systems. In particular, how/when would/should a data
access layer (DAL) class use disconnected data?
I can see how my DAL could load all the various "lookup" (eg, mostly
read-only) tables into one or more datasets, and then return them to its
app/business logic-layer clients upon request. For example, a GetStates()
method might return a dataset (or collection?) containing all the state
codes.
But what about tables that are frequently updated, like "Orders"? Assuming
the DAL also loads those tables into dataset(s), when should DAL invoke the
DataAdapter's .update method to update the underlying database? To be safe,
I assume that it would need to do so after any client call (eg, AddOrder)
that updates the dataset.
But is this really best practice? Or should heavily-updated (but rarely
queried) tables NOT be loaded into datasets, but rather be accessed in
"connected" mode, using command objects?
And I suppose this brings-up an even more basic question: what advantage is
the disconnected paradigm when the database is 1) only used by one app and 2)
local to the app ?
Any guidance would be greatly appreciated...
datasets with n-tier systems. In particular, how/when would/should a data
access layer (DAL) class use disconnected data?
I can see how my DAL could load all the various "lookup" (eg, mostly
read-only) tables into one or more datasets, and then return them to its
app/business logic-layer clients upon request. For example, a GetStates()
method might return a dataset (or collection?) containing all the state
codes.
But what about tables that are frequently updated, like "Orders"? Assuming
the DAL also loads those tables into dataset(s), when should DAL invoke the
DataAdapter's .update method to update the underlying database? To be safe,
I assume that it would need to do so after any client call (eg, AddOrder)
that updates the dataset.
But is this really best practice? Or should heavily-updated (but rarely
queried) tables NOT be loaded into datasets, but rather be accessed in
"connected" mode, using command objects?
And I suppose this brings-up an even more basic question: what advantage is
the disconnected paradigm when the database is 1) only used by one app and 2)
local to the app ?
Any guidance would be greatly appreciated...