title: How does object reuse work in .NET?
body: <p>I've recently moved from VB6 to VB.NET and I am finally getting there with understanding the inner workings. I've been looking at my company's existing codebase and I am a little suprised. </p>
  
  <p>I understand that when VB.NET creates a string it see's if the string is in memory and if not creates a new instance of that string, otherwise it points the new variable to the old . However I wonder if it does this with other objects?</p>
  
  <p>The reason I ask is my new company has a DATABASE object which basically wraps database connection info and database connections in a object.</p>
  
  <p>We also have a BOOK object and a PAGES object.</p>
  
  <p>My best practice in VB6 would be to create a DATABASE object and then pass (byRef) that to the BOOK and then PAGES object, so you have one DATABASE object passed to muliple books and then PAGES.</p>
  
  <p><em>However</em>, how they have done it is to create a new instance of the DATABASE object in each PAGE and each PAGE object, which means you could have muliple instances (thousands in fact) of objects which are in fact all the same.</p>
  
  <p>Is this wise? Or do objects get handled like Strings?</p>