Wrox Programmer Forums
|
ASP.NET 3.5 Professionals If you are an experienced ASP.NET programmer, this is the forum for your 3.5 questions. Please also see the Visual Web Developer 2008 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 3.5 Professionals 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 September 15th, 2011, 04:10 PM
Authorized User
 
Join Date: Aug 2006
Posts: 41
Thanks: 1
Thanked 0 Times in 0 Posts
Default Correctness versus speed

Hi,
I wondering if you can help me settle a debate i'm having with my boss about correctness versus speed.

He thinks that for lots of enum tables we have in our database, e.g. tables you use to populate dropdowns such as a list of Countries (Id and Name columns), we should have a single DA layer function call where we pass in the "table name" and create the SQL query on the fly, e.g. "SELECT Id, Name FROM" + tablename . Then return a List of a custom NameValuePair class. This DA layer would be called on the front end via the BizLogicLayer by the following mechanism...

Say you have a dumb DTO instantiated class called Person, which has a CountryId integer property (basically the foreign key value). And you're now on a Person edit screen. He wants to decorate the CountryId property of the Person class with an attribute that tells you the "table name" and extract this via refelection to then pass to the DA layer (as above) to get all the country values for the person edit screen.

My technique would be to create a DA method and stored proc per enum table, and on the edit screen, call the correct DA layer via the BizLayer to get the name/value pairs for the the dropdowns

His thought is that with lots of enum tables we have to create lots of repetitve code to do the same job, e.g. return name value pairs.

My argument is that everything is strongly typed, it's implicit, but it does mean a little bit more coding. But everyone will know when calling the DA layer, they'll have something like DA.GetCountries, DA.GetColors, etc, etc.

What he's proposing does work, but its very dirty using dynamic SQL and using dumb DTOs tied to table names. Can you give me some thoughts on how I can turn his thoughts around on this one?!
 
Old October 19th, 2011, 05:54 AM
Registered User
 
Join Date: Oct 2011
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

either way its correct.....





Similar Threads
Thread Thread Starter Forum Replies Last Post
Comma Versus Dot Wenggo Javascript 6 March 1st, 2011 03:37 AM
chapter 5 : unicode versus ascii ew6014 BOOK: Beginning C# 3.0 : An Introduction to Object Oriented Programming ISBN: 978-0-470-26129-3 1 February 19th, 2010 01:08 AM
validateOnParse versus xsi:nil JaKKe XML 0 March 7th, 2006 07:23 AM
User versus Application Role aousterhout SQL Server 2000 0 April 20th, 2004 05:20 PM





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