Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 4 > ASP.NET 4 General Discussion
|
ASP.NET 4 General Discussion For ASP.NET 4 discussions not relating to a specific Wrox book
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 4 General Discussion section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 10th, 2012, 04:56 PM
Authorized User
 
Join Date: Dec 2011
Posts: 39
Thanks: 9
Thanked 0 Times in 0 Posts
Default From a professional pov, should i use tableadapters or classes?

I am graduating with a CS degree this summer and I am aspiring to be a software engineer and/or software developer.

I am taking an independent study on asp.NET as my final class and I will be tasked to build an e-commerce site.

I really want to do this right. I am going to dedicate several weeks to creating several UML diagrams and really getting my design and documentation down pat.

The thing is, I have been using tableadapters for all my web projects so far and I think they are great. But I am really interested in Imar's N-layered architecture articles and I am strongly considereing taking this approach and building classes to access my data through.

In the real world, are tableadapters used frequently and if not, why? What are the advantages to coding all of the Data Access Layer logic manually using classes and such?

Thanks.

Last edited by IceThatJaw; March 10th, 2012 at 05:15 PM..
 
Old March 12th, 2012, 03:22 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

Quote:
In the real world, are tableadapters used frequently and if not, why?
Yes, but in a lot of legacy applications. I don't use them for new sites anymore, and I thnk that's the common theme. They had their use back in the early days of .NET, but there are better alternatives now.

If I were you, I'd look at the Entity Framework, with optionally the Code First option. I am working on an update of my article series about N-Layer design using ASP.NET 4.5 where I'll use EF Code First as well. However, it may take a loooooong time before the series is done so don't wait for it......

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
The Following User Says Thank You to Imar For This Useful Post:
IceThatJaw (March 12th, 2012)
 
Old March 12th, 2012, 10:15 AM
Authorized User
 
Join Date: Dec 2011
Posts: 39
Thanks: 9
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by Imar View Post
Hi there,

Yes, but in a lot of legacy applications. I don't use them for new sites anymore, and I thnk that's the common theme. They had their use back in the early days of .NET, but there are better alternatives now.

If I were you, I'd look at the Entity Framework, with optionally the Code First option. I am working on an update of my article series about N-Layer design using ASP.NET 4.5 where I'll use EF Code First as well. However, it may take a loooooong time before the series is done so don't wait for it......

Cheers,

Imar
Ok, this is great advice. Now the code first option in EF from what I understand is designed so that you can build your DAL without actually creating a database schema in a DBMS.

I'm still unclear on why that is so advantageous but I will try it out.

Thanks.
 
Old March 12th, 2012, 10:28 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Quote:
from what I understand is designed so that you can build your DAL without actually creating a database schema in a DBMS.

I'm still unclear on why that is so advantageous but I will try it out.
The biggest advantage is that you can design your model without having to think about the database. This means you can freely design your model with, for example, object inheritance and let EF handle the database generation for you. You still have a lot of control over how the database is generated though.

Alternatively, use EF Database First or Model First if you like these models better.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
The Following User Says Thank You to Imar For This Useful Post:
IceThatJaw (March 12th, 2012)





Similar Threads
Thread Thread Starter Forum Replies Last Post
TableAdapters in Visual Studio 2005 lisabb ASP.NET 2.0 Basics 0 July 18th, 2007 11:44 AM
Using classes seymour_glass C# 1 April 26th, 2007 10:18 PM
Switching TableAdapters striker9 ASP.NET 2.0 Basics 3 March 29th, 2006 11:11 AM
About Classes. wdw BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 0 July 29th, 2005 08:46 AM
Classes CodeMonkeys C# 3 August 18th, 2004 11:14 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.