Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Quick parameter/efficiency question

Status
Not open for further replies.

RhythmAddict112

Programmer
Jun 17, 2004
625
US
Hi all,
Real quick question. I have a page/class named Default.aspx...I've also got a base class called Report, and various reportTypes that inherit from it - one of which is "Department. My question is the following... When I instantiate the Department type within the Default page/class....Is it more efficient to use a constructor that passes the entire Default class, thus providing me with access to various drop down lists and other controls on the page, or is it better to actualyl pass the values of each drop down list/control on the default page into the constructor...Ie

Method 1
Deparment Dpt = new Department(this); //pass class entirely

Method 2
Deparment Dpt = new Department(string ddlOne.selectedValue, string ddlTwo.selectedValue, etc...); //pass string params

Thanks in advance!

 
I'd guess it depends on whether you need access to any of the other values in the "Department" class. If not, I'd just go with your second method although there's probably not much difference between speed and memory usage between the two methods.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top