Hey AJ,
First of all, there isn't enough benefit in my eyes in subjecting yourself
to C++ if you are dealing with pure managed code. (Your data tier).
Secondly, DataReader is connected .. sure .. but can be easily made
disconnected (search my blog for "How to create a databindable data
reader"). BTW, that is also the mostest efficientest way atleast AFAIK to
get disconnected data from the d/b. The only more efficient and pure .NET
way is to use a connected datareader. And in multi user scenarioes that just
might not be very efficient (since it'd have the tendency to block open
connections for a longer period).
Finally, a huge object such a dataset might have one odd thing in it that is
set to ComVisible(False). in other words, I am a bit leery about exposing a
huge object as a dataset via interop to a COM thing. It is certainly
possible, but you might run into practical problems that any amount of
theory (typically books) won't apprise you of. Most books touch the most
simplistic approach and leave it there.
I personally would be more comfortable with creating your own business
objects, populating them in the managed business layer using the dataset
received from the data layer, and sending that to C++/COM libraries that you
might already have.
Call me a pessimist, but when it comes to dealing with COM/.NET Interop, I
am much more comfortable in dealing with objects that I have full control
over. I've had plenty of unexplained problems there :-/ . like Method "~" of
object "~" failed .. (How do you decipher that .. especially if it were
coming from deep within the very complicated RCW for the dataset). Also, how
..NET objects are exposed to COM via interop, how it has to go thru
mscoree.dll, which shims a COM component and finds the dll for you, it isn't
the simple RegSvr32 registration, in other words, it is so not a COM
component anymore .. that I'd much rather stick with simpler objects going
over that layer. .. oh and not to mention garbage collection for COM/.NET
mixture .. .. enough reasons already
So my recommended solution is
Database <--> C# .NET DataLayer <-(dataset or something else) ->
Business Layer --> UltraDumbAndSimpleAndFullySerializableBizObject
<---interop--> Win32.
- Sahil Malik
http://dotnetjunkies.com/weblog/sahilmalik