Archives / 2004 / October
  • Class, DAL, and Performance

    Say I have a class (MyClass) with 20-30 properties.  On a page hit I instantiate MyClass and pass it to my DAL to bind the properties from a record in a database.  Then go about binding Labels, TextBoxes, etc from properties associated with MyClass. 
    Well what if my .aspx page only uses one property in the class?  Is it  not overkill to instantiate the class, pass it to my DAL, bind 20-30 properties only to use one string property to display in a Label?  If a page does not use all/most of the properties of a class, it seems like a lot of mashing using this method.  On a low traffic site, I am sure this is ok, but on a site that gets pounded....
    Or am I going about this completely wrong...  How *should* something like this be handled?  Because I am sure I am missing something.