John,
I don't like TableAdapters
, I don't think they are suited well enough
to
a production enterprise application.
Why?
- They suck eggs with System.Transactions (watch out for my coming
article
in code-magazine on this).
- They donot have transactional support built into them, adding that on
top
is painful
- They are very single table specific
- They are impossible to make work with multiple tables in hierarchcial
scenarios and concurrent environments reliably
- They have poor concurrency mangement options built into them
- Do they use generics? I don't think they do.
- They are unweildy to maintain as your db structure changes
- They are very structure specific, so you need multiple table adapters
for
every single get/update scenario
- They have hardcoded queries in them (which don't even use StringBuilder
by the way), the generated code of strongly typed datasets is quite awful.
- If you need custom persistence logic, save this record and send me an
email on success - you're screwed with TableAdapters, it's going to be
built
on top in a very inelegant way.
- Your DBA will hate you if subject them to the queries TableAdapters
generate by default
- and more
I have given enough attention to this topic as I felt it deserved in Chaps
3
and 6. But truthfully, I have clearly stated my opinions in chapter 3 that
a
drag drop application is not what you want in any real application. So
TableAdapter isn't necessarily the "new way of doing things" - it is
merely
the new demonstration Microsoft guys could give to wow the CIO of your
company. That is probably what MS uses to sell .NET LOL
. Now once you
do
get .NET in, you probably want a hand architected/hand written ADO.NET
application for any serious task.
Now I'm a bit tickled to hear that MSDN docs highly recommend to use
these.
Can you point me to specific articles so I can argue with the appropriate
folks? I don't like the default drag drop goo that is generated in .NET
2.0 - Datasets and TableAdapters both. And I want to argue and find out if
I'm talking out of my ar*se or do I really have a point. In some manner, I
wish to be able to give my honest feedback to Microsoft, so it would be
incredibly helpful if you could point me to specific MSDN articles that I
should bitch about
. Regards Learnvisualstudio.net videos - Well, some
folks buy into the MS koolaid and talk like MS marketing, I'm probably one
of them to some extent. And some folks try to bring forth the real deal -
here is what is good, here is what sucks. I haven't seen those videos so I
cant comment, but I've done videos for keystonelearning.com and over there
I
mentioned TableAdapter a bit and said "WOW HOW COOL" and then showed the
code it generated and how bad that was and said "OH THIS SUCKS". and WTF
do
I do now .. and then I show the real deal, how to actually use the objects
to do the right thing.
It's all a question of sifting chaff from the wheat man
Unless you are creating a single user app, non-production - drag drop get
over with and move on with life, TableAdapter may work for you and my book
tells you enough to get by with that. For anything serious and practical,
forget this Drag Drop goo. And trust me, in the base framework libraries,
ADO.NET 2.0 has **PLENTY** of new and good stuff.
- Sahil Malik [MVP]
ADO.NET 2.0 book -
http://codebetter.com/blogs/sahil.malik/archive/2005/05/13/63199.aspx
__________________________________________________________