title: Is it memory inefficient to instantiate classes in a getter method? What OOP design prevents this?
body: <p>I have a getter method that instantiates classes from deserialized data. I suspect this is a terribly inefficient way of doing things</p>
  
  <pre><code>class Container {
    get content() {
      let contentList = []
      for (let c of this._content) { // this._content is an array of objects
        contentList.push(new ContentTypes[c.type](c)) //ContentTypes is a mapping between type names and classes
      }
      return contentList
    }
  }
  </code></pre>
  
  <p>What's the appropriate design pattern in OOP land?</p>