Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3
This is the forum to discuss the Wrox book Beginning ASP.NET 3.5: In C# and VB by Imar Spaanjaars; ISBN: 9780470187593
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 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 October 9th, 2009, 12:22 PM
Registered User
 
Join Date: Oct 2009
Posts: 5
Thanks: 2
Thanked 0 Times in 0 Posts
Default automated code vs. manual

I'm working through this book, and I keep wondering just how much of the automated code/wizards a pro uses. I have about 10 years web development experience with non oop languages.

Let's take a pet inventory data entry form, for instance. I'm used to writing the sql to retrieve the appropriate records from the db, iterating through the records to set up a table or div display of the data, and adding edit inputs. On data submission side, I would validate the data and write the insert/update query. This method actually seems much easier to me than using all the wizards and auto-configuration tools that then generate the code for you. Plus, I you can't see the code that is generated, so if/when I have to troubleshoot, it makes it much tougher.

So my question is what is the middle ground? How would a seasoned .net developer approach the above scenario? Would he/she use the girdview wizard to bind the data, etc., or use that same tag code that gets generated - but code it him/herself. Or would he/she retrieve the data into a dataset, iterate through it, manipulating it as it may need and present it with manual html, css markup? Why NOT do it that way if one has the skills?

Last edited by convert21; October 9th, 2009 at 12:24 PM..
 
Old October 10th, 2009, 04:10 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,

The answer, as always in this field, is: it depends.

Controls like the GridView and technologies like LINQ to SQL or ADO.NET Entities are real, and for real. I've built or designed many large, professional web sites that use these technologies. They work well and can result in great sites.

However, they don't always cut it. A DetailsView connected to a LinqDataSource is not always enough. Often, I create separate details pages with separate controls (no DetailsView, FormView and so on) and get data from a business layer that in turn talks to the database. How you get the data from the database is up to you: Entities, custom in-line SQL code, stored procedures and so on.

In short: I try to rely on code generation (from Visual Studio or from external tools) where possible. Once you have a good feel of these tools work, you can really rapidly create well functioning applications. For more advanced scenarios, or where more control is needed, I typically use more custom code.

You mway want to take a look here to see a design of a real world application: http://imar.spaanjaars.com/QuickDocId.aspx?quickdoc=476

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:
convert21 (October 10th, 2009)
 
Old October 10th, 2009, 09:54 PM
Registered User
 
Join Date: Oct 2009
Posts: 5
Thanks: 2
Thanked 0 Times in 0 Posts
Default

Hi Imar,
Thanks again! I understand what you are saying. It makes good sense.
Any chance you could expand on this statement? "Often, I create separate details pages with separate controls (no DetailsView, FormView and so on)"

What kind of "control" would that be then? A custom control? What would an example of this be?

Chapter 15 almost down... 3 more to go! Then it's on to Beginning C# 3.0: An Introduction to Object Oriented Programming by Jack Purdum - already ordered!

I appreciate your responses so far.
 
Old October 11th, 2009, 02:41 AM
Registered User
 
Join Date: Oct 2009
Posts: 5
Thanks: 2
Thanked 0 Times in 0 Posts
Default

duh - you meant html controls, i.e., radio button, text box, etc., right?! I was thinking too hard...
 
Old October 11th, 2009, 04:25 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Yes, exactly. One way or the other, the browser usually needs HTML to build up the UI. Controls like the DetailsView serve as composite controls enabling you to configure one control while the control itself manages many different controls internally.

While manually creating forms is a bit more work, I typically don't mind the increased complexitiy it brings because of the increased flexibility...

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!





Similar Threads
Thread Thread Starter Forum Replies Last Post
Previous manual back-ups Neal SQL Server 2005 7 February 13th, 2009 05:13 AM
Gridview manual databinding through code thas123 ASP.NET 2.0 Basics 3 December 12th, 2006 01:18 PM
Manual Submit Digon Classic ASP Basics 2 December 28th, 2005 08:24 PM
Crystal manual crosstab Eric Butterfield Crystal Reports 1 February 18th, 2005 06:42 PM
Manual Copy-Of aberglas XSLT 1 February 17th, 2005 05:40 AM





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