By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,357 Members | 1,021 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,357 IT Pros & Developers. It's quick & easy.

Check whether my Process flow is correct or not

P: 90
I did a small sample with three tier architecture and i need to know whether the flow of the program is correct or not.The pgm works fine.

Inside web.config
Expand|Select|Wrap|Line Numbers
  1. <configuration>   <appSettings>     <add key="Connection" value="server=.;trusted_connection=true;initial catalog=sanjay"/>   </appSettings></configuration>
Inside Data Access Layer
Expand|Select|Wrap|Line Numbers
  1.  private string username; 
  2.  private string password;
  3.  public string UserName   
  4.   {  
  5.   get { return username; }  
  6.  set { username = value; }  
  7.   }  
  8.  public string PassWord 
  9.   {
  10.  get { return password; }     
  11. set { password = value; }  
  12.   }   
  13.   public int checking(string username,string password)  
  14.    {        
  15.  int temp = 0; 
  16.  SqlDataReader dr;    
  17.  string con = ConfigurationManager.AppSettings["Connection"].ToString();         SqlConnection connection = new SqlConnection(con);         connection.Open();
  18.   SqlCommand cmd = new SqlCommand("select * from pass where username='" + username + "' ", connection); 
  19.   dr = cmd.ExecuteReader(); 
  20.  while (dr.Read())  
  21.   {    
  22.  string a = dr.GetValue(0).ToString();
  23.  string b = dr.GetValue(1).ToString();   
  24.  if ((a.Equals(username)) && (b.Equals(password)))   
  25.         {
  26.             temp= 1;       
  27.         }    
  28. else      
  29.        {    
  30.             temp= 0;   
  31.          } 
  32.   }    
  33.   return temp;    
  34.  dr.Close();       
  35.  connection.Close();   
  36.   }
  37.  
Inside Business access layer

Expand|Select|Wrap|Line Numbers
  1.  public int checking(string username,string password)
  2.     {
  3.         Dal d = new Dal();
  4.         return d.checking(username,password);
  5.     }
Inside Presentation layer


Expand|Select|Wrap|Line Numbers
  1. protected void Button1_Click(object sender, EventArgs e)
  2.     {
  3.         string uname = TextBox1.Text;
  4.         string pwd = TextBox2.Text;
  5.  
  6.         if (Convert.ToBoolean(b.checking(uname,pwd)))
  7.         {
  8.             Button1.Text = "valid";
  9.         }
  10.         else
  11.         {
  12.             Button1.Text = "Invalid";
  13.         }
  14.  
  15.     }
I need to know whether my program flow is correct or is there any modifications need to be done.

Thanks

Regards
Raghul
Sep 8 '08 #1
Share this Question
Share on Google+
3 Replies


Frinavale
Expert Mod 5K+
P: 9,731
If your program works properly then why would the flow be incorrect?

In order for your program to work properly, some steps need to be taken before other steps can be executed...if you've tested your application and have determined it to be correct then why is your process flow in question?

If you really want to check things I suggest using the Debugger tool that comes with Visual Studio to step through your application as it's running and confirm that the flow is correct.

-Frinny
Sep 8 '08 #2

P: 90
Sir,

I need to know whether the people working in the CMM level 5 Companies use the same type as I did or do they follow some other guidelines in order to complete their task.
ie for example in my sample i got the username and password and i checked that in the same data access layer and then returned only the int value (0 or 1)
to the business access layer, but I need to know whether the people working in CMM level companies get those values (username and password) as parameters and send those via parameters to business layer and do the checking there and then from there return a Boolean value to presentation layer.

Thanks,

Raghul

If your program works properly then why would the flow be incorrect?

In order for your program to work properly, some steps need to be taken before other steps can be executed...if you've tested your application and have determined it to be correct then why is your process flow in question?

If you really want to check things I suggest using the Debugger tool that comes with Visual Studio to step through your application as it's running and confirm that the flow is correct.

-Frinny
Sep 10 '08 #3

Frinavale
Expert Mod 5K+
P: 9,731
Sir,

I need to know whether the people working in the CMM level 5 Companies use the same type as I did or do they follow some other guidelines in order to complete their task.
ie for example in my sample i got the username and password and i checked that in the same data access layer and then returned only the int value (0 or 1)
to the business access layer, but I need to know whether the people working in CMM level companies get those values (username and password) as parameters and send those via parameters to business layer and do the checking there and then from there return a Boolean value to presentation layer.

Thanks,

Raghul
I know very little about the Capability Maturity Model (CMM) that you mentioned above, but from what I understand it is a Guideline to aid in the definition/understanding of an organization's processes. There are many different ways to implement a solution for a problem, the CMM guidelines help you to develop applications that are well defined, easy to understand, reliable and maintainable.

The approach that you have taken here is one that I have taken myself on many occasion but it doesn't mean that the solution is best suited for your business logic.

It is your responsibility to analyze your application and decide if it is best suited for your needs. The Capability Maturity Model is a tool to aid you in this process and I urge you to use it to create your own well defined structure for your application.

You may want to take the time to look into existing patterns and practices to help you solve your problem...but those too are just guidelines.

-Frinny
Sep 10 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.