Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Please review the below 2 methods as examples and advise on the below questions
1. which is the better to define considering the PERFORMANCE (i know performance also depends on the load,Server configuration and other x factors)
2. what happens when the 2nd method gets multiple requests, i mean for ex when 6 concurrent users submitting their bio-data at the same time, using 2nd method but with different parameters?
3. how it(CLR) handles multiple requests accessing same method at same time with different parameters.?
4. Is it safe to use the 2nd method considering there might be a minimum of 20+ users accessing the same class/method.?
Please advise..

//class declaration
public class insert_students_data()
{
//fields..
//properties..
//constructors..etc..
//Now Class Methods
1st Method:


public void insert_1st_Std_data_individually()
{
//here i will be inserting only 1st standard students bio data
}

public void insert_2nd_Std_data_individually()
{
//here i will be inserting only 2nd standard students bio data
}

public void insert_3rd_std_data_individually()
{
//here i will be inserting only 3rd standard students bio data
}

2nd Method:


public void insert_all_students_data_globally(string qryfrom_PL)
{
//here i will insert the bio-data of all the students based on the parameter 'qryfrom_PL', passed from button click event of Presentation Layer.
}

}

Even i dont prefer the 1st method,since it lacks code re-usability,but my question is "how the 2nd Method handles the requests, when say 50+ students of different standards trying to submit
their bio-data, and all 50+ requests references the same class/same method but with different parameters"

Thanks in advance.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900