Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsOtherProgramming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old April 20th, 2006, 03:26 PM
appdevman appdevman is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Apr 2006
Posts: 1 appdevman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 m 7 sec
Reputation Power: 0
Talking Question On Dal Component Design Std

I have a question on standards in design practices for DLL's / components.

I build large systems that are typically all DLL's, that we then assemble in either an ASP.Net application, Windows Service, or Windows Forms app.

Look at this line of code. If the query this business object (objDAL) runs returns ZERO rows, should this function return me a datatable with zero rows, OR, should it return NOTHING. (which means afterwards, I have to check for the object being NOTHING, before I check rows.count)

dtbWidgets = objDAL.getWidgets(strColor)

If the function returns a datatable with zero rows, I can check the rows.count without getting an exception.
Otherwise, I have to add an addition line(s) of code, first checking if dtbEmps is Nothing, before proceeding onwards.

What is the norm out there for when the query happens to return zero rows?
Are people coding to return Nothing, or table objects with no rows?

thanks,
appdevman

Reply With Quote
  #2  
Old April 23rd, 2006, 07:30 AM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is offline
Moderator From Beyond
ASP Free God 46th Plane (27500 - 27999 posts)
 
Join Date: Sep 2004
Location: Israel
Posts: 27,635 Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)  Folding Points: 373781 Folding Title: Super Ultimate Folder - Level 1Folding Points: 373781 Folding Title: Super Ultimate Folder - Level 1Folding Points: 373781 Folding Title: Super Ultimate Folder - Level 1Folding Points: 373781 Folding Title: Super Ultimate Folder - Level 1Folding Points: 373781 Folding Title: Super Ultimate Folder - Level 1Folding Points: 373781 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Months 2 Weeks 2 h 55 m 37 sec
Reputation Power: 1902
think of your closet. usually, it contains clothes, right?

suppose you run query like this:
"how many green shirts I have in my closet?"

if there are no green shirts, this query should return zero.
however, if there is no closet at all, the query should inform this
by returning NULL instead of zero - it can also raise custom Error as well.

so, if the getWidgets function run correctly and there are simply
zero records, just return zero.

returning NULL/Empty is more "severe" than returning zero.

Reply With Quote
Reply

Viewing: ASP Free ForumsOtherProgramming Help > Question On Dal Component Design Std


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT