CodeVerge.Net Beta


   Explore    Item Entry    Members      Register  Login  
NEWSGROUP
.NET
Algorithms-Data Structures
Asp.Net
C Plus Plus
CSharp
Database
HTML
Javascript
Linq
Other
Regular Expressions
VB.Net
XML

Free Download:




Zone: > NEWSGROUP > Asp.Net Forum > starter_kits_and_source_projects.commerce_starter_kit Tags:
Item Type: NewsGroup Date Entered: 4/30/2003 2:48:28 AM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 3 Views: 12 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
4 Items, 1 Pages 1 |< << Go >> >|
ljp007
Asp.Net User
Two Questions about IBS Store programming methods4/30/2003 2:48:28 AM

0/0

I have two questions about the IBS Store Programming Methodology hopefully someone can clarify.


1) Throughout the CustomersDB class the variable, customerID, is passed into Functions as a String (ByVal CustomerID As String). However, once inside the function(s) the customerID variable is Cast to an Integer, CInt(customerID). Why didn?t they simply declare the customerID variable type as Integer and avoid having to type cast in every function which uses the variable? Clearly, the developers thought of this when they developed IBS, but for some reason they decided to use this technique, presumably for stability. Why?

2) On many of the IBS .aspx pages, ShoppingCart.aspx ?for one, there are a number of Sub Procedures which instatiate and dimension the same objects and variables. On ShoppingCart.aspx there are 3 different subs (Sub UpdateShoppingCartDatabase(), Sub PopulateShoppingCartList(), Sub CheckoutBtn_Click) which all instantiate the same object:

Dim cart As IBuySpy.ShoppingCartDB = New IBuySpy.ShoppingCartDB()


Then dimension the same variable:

' Obtain current user's shopping cart ID
Dim cartId As String = cart.GetShoppingCartId()

My question is why didn?t the developers simply declare this object and variable outside any Sub Procedures and make them accessible to all the Subs throughout the page ? which would have saved time and called for less code-- ?
asmason
Asp.Net User
Re: Two Questions about IBS Store programming methods4/30/2003 7:07:50 AM

0/0

Hi,

Regarding your first question, I agree it does seem a little wierd. Maybe the developers wanted to keep everything but Strings out of presentation logic. Maybe they just got carried away with Strings, since the cartId holds a String when it is a GUID, but then an Integer once the customer has logged in / registered. It could be just a case of inconsistency.

Regarding your second question, they do not declare class scope variables because it is normal practice to use the lowest scope possible. Things would be very messy otherwise!

Regards,

Anthony




Anthony Mason MCSD
ljp007
Asp.Net User
Re: Two Questions about IBS Store programming methods4/30/2003 9:07:00 PM

0/0

Regarding the second question. I understand. I guess they did it for consistency and readability -- as well as being a best practice. However, on a page which calls a couple subs and which uses the same object and variable, I use this on many of my .aspx pages without problem. Saves time and typing without any problem.
dcpennington2
Asp.Net User
Re: Two Questions about IBS Store programming methods10/15/2003 3:30:47 AM

0/0

You are correct in that yours seems a more efficient way to go from a writing stand-point. I think one simple consideration the developers of IBS may have made was that the code within this would be looked over by experts as well as many complete novices... And while the whole thing may have been coded purely with efficiency in mind, it was a better route to allow little bits of code to speak for themselves rather than be more efficient.

This project, after all, is a demonstration that was intended for dissection and analysis by a huge and diverse audience. They avoided a lot of complexities to make it universally learnable. IBS may not be without some inefficiencies, but people like you who are openly expressing other possibilities and better ways to do small tasks are what is making this community better as a whole.

Keep it up :)

Daniel Pennington
MCSD, MCDBA
Daniel Pennington
(Insert Significant Credentials and Witty Comment Here)
4 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
ASP.NET by Example Authors: Steven A. Smith, Pages: 552, Published: 2002
The Software Catalog: Microcomputers, Winter, 1990 Authors: Menu International Software, Pages: 0, Published: 1990
CNC Programming: Principles and Applications Authors: Mike Mattson, Pages: 358, Published: 2002
Advanced Information Systems Engineering: 9th International Conference, CAiSE '97, Barcelona, Catalonia, Spain, June 16-20, 1997 : Proceedings Authors: A. Olivé, Joan Antoni Pastor, Pages: 450, Published: 1997

Web:
Two Questions about IBS Store programming methods - ASP.NET Forums Two Questions about IBS Store programming methods. Last post 10-14-2003 11:36 PM by dcpennington2. 3 replies. Sort Posts: ...
One Questions about IBS Store programming methods - ASP.NET Forums One Questions about IBS Store programming methods. Last post 10-20-2003 6:15 PM by WhatThe12. 2 replies. Sort Posts:. Oldest to newest, Newest to oldest ...
Acacia and IBS Products in Stores Mar 8, 2005 ... If you would like a store in your area to carry any of the Heather's Tummy Care products (as well as the IBS Audio Program 100 self-hypnosis ...
Amazon.com: IBS Audio Program 100 ~ For Irritable Bowel Syndrome ... But years after completing the program, I can still say it was the best treatment method for my IBS, reducing my symptoms over 95% and gave me my life back ...
IBS - College Radio Program list from Randall Davidson for college ... For outstanding radio and webcasting it takes two, IBS and YOU! ...... WE'RE SCIENCE -weekly 29 minute program answering questions submitted by listeners ...
Irritable Bowel Syndrome : Frequently Asked Questions ... He or she should be willing to go over your questions and concerns, and outline and monitor a program of treatment for your individual case of IBS. ...
Online Bibles from IBS-STL IBS has an extensive list of online Bibles including the NIV Bible, ... kids around the world receive this through the My Monthly Bible Reader program! ...
Best Colon Cleansing and Body Detox Programs Two days into the program I was sold and shared my experiences with friends ... I have had IBS since I was in the 8th grade, and for the first time in years ...
IBS COMPUTER ORIENTATION 2) If there is no icon for the program on the desktop, click the Start button ... screened and trained, to answer questions and to troubleshoot hardware and ...
chapters.indigo.ca: I.B.S. Relief: A Doctor, A Dietitian, And A ... IBS releif answers all the questions you havn't even thought of yet. ... Check if this product is available in our stores. tell us your location ...

Videos:
Irritable Bowel Syndrome (IBS) Video Consultation #3 of 4 This video discusses Dr. Dahlman's Irritable Bowel Syndrome (IBS) diet. It discusses how diet can be a part of the causes of irritable bowel syndrom...




Search This Site:










how to keep polling the databaseevery two minutes using .net

why is asp.net in my user account

user creation

internal webserver vs iis

popup window with item template (gridview)

the problem of composite control

login with ms access database...?

asp: hyperlink help needed

use vwd 2008 express to open windows 2008/iis7 site

menu

commenting

how to remove a meta tag

nice write-up

windows scheduled task - how do i write one using .net?

change cannot be applied because code is locked by a master page

copying website from localhost to hosted server

request.form not working over https

rad editor removes absolute image paths

module data depending on roles vs. different pages per role

how to get & show permissions of an particular group

how would i go about changing a dnn site to another host?

how can i assign a user to a particular role?

web form editor

difference - image button link(old) - imagebutton(new)

binding

upgrade options for dnn 3.0.13 - help!!

2.1.2 portal administrator security problem

inetrnal web browser [map with which version of ie]

extra space above modules

setting up dotnetnuke

 
All Times Are GMT