Check whether my Process flow is correct or not

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • raghulvarma
    New Member
    • Oct 2007
    • 90

    Check whether my Process flow is correct or not

    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
    Code:
    <configuration>   <appSettings>     <add key="Connection" value="server=.;trusted_connection=true;initial catalog=sanjay"/>   </appSettings></configuration>
    Inside Data Access Layer
    Code:
     private string username; 
     private string password;
     public string UserName   
      {  
      get { return username; }  
     set { username = value; }  
      }  
     public string PassWord 
      {
     get { return password; }     
    set { password = value; }  
      }   
      public int checking(string username,string password)  
       {        
     int temp = 0; 
     SqlDataReader dr;    
     string con = ConfigurationManager.AppSettings["Connection"].ToString();         SqlConnection connection = new SqlConnection(con);         connection.Open();
      SqlCommand cmd = new SqlCommand("select * from pass where username='" + username + "' ", connection); 
      dr = cmd.ExecuteReader(); 
     while (dr.Read())  
      {    
     string a = dr.GetValue(0).ToString();
     string b = dr.GetValue(1).ToString();   
     if ((a.Equals(username)) && (b.Equals(password)))   
            {
                temp= 1;       
            }    
    else      
           {    
                temp= 0;   
             } 
      }    
      return temp;    
     dr.Close();       
     connection.Close();   
      }
    Inside Business access layer

    Code:
     public int checking(string username,string password)
        {
            Dal d = new Dal();
            return d.checking(username,password);
        }
    Inside Presentation layer


    Code:
    protected void Button1_Click(object sender, EventArgs e)
        {
            string uname = TextBox1.Text;
            string pwd = TextBox2.Text;
    
            if (Convert.ToBoolean(b.checking(uname,pwd)))
            {
                Button1.Text = "valid";
            }
            else
            {
                Button1.Text = "Invalid";
            }
          
        }
    I need to know whether my program flow is correct or is there any modifications need to be done.

    Thanks

    Regards
    Raghul
  • Frinavale
    Recognized Expert Expert
    • Oct 2006
    • 9749

    #2
    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

    Comment

    • raghulvarma
      New Member
      • Oct 2007
      • 90

      #3
      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

      Originally posted by Frinavale
      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

      Comment

      • Frinavale
        Recognized Expert Expert
        • Oct 2006
        • 9749

        #4
        Originally posted by raghulvarma
        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

        Comment

        Working...