Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 4 > ASP.NET 4 General Discussion
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 10th, 2012, 04:56 PM
Authorized User
Points: 173, Level: 3
Points: 173, Level: 3 Points: 173, Level: 3 Points: 173, Level: 3
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
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..
Reply With Quote
  #2 (permalink)  
Old March 12th, 2012, 03:22 AM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 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!
Reply With Quote
The Following User Says Thank You to Imar For This Useful Post:
IceThatJaw (March 12th, 2012)
  #3 (permalink)  
Old March 12th, 2012, 10:15 AM
Authorized User
Points: 173, Level: 3
Points: 173, Level: 3 Points: 173, Level: 3 Points: 173, Level: 3
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
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.
Reply With Quote
  #4 (permalink)  
Old March 12th, 2012, 10:28 AM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 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!
Reply With Quote
The Following User Says Thank You to Imar For This Useful Post:
IceThatJaw (March 12th, 2012)
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 06:29 AM.


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