title: Are class level variables/objects acceptable?
body: <p>I have a simple web site built with asp.net.  It typically only has 1 or 2 users at one time.  My question is, is it ok to instantiate a class at the class level or should I be instantiating for each method.  Here is an example.  I have a class named Host with a name field and mac field.  In my code behind for a specific page Is it ok to do this:</p>
  
  <pre><code>public partial class addhosts : Page
  {
       private Host host = new Host();
       private HostDal dal = new HostDal();
  
       protected void myMethod()
       {
            host.Name = "myname"
            host.Mac = "mymac"
       }
  
       protected void btnSubmit_Click(object sender, EventArgs e)
       {
            dal.AddHost(host)
       }
  }         
  </code></pre>