Five Minutes Tech

Technical topics to grasp in 5 minutes

Menu

Skip to content
  • Design patterns
  • Effective Java
  • Java
  • JVM
  • Interview questions
  • JavaScript/React
  • Web
  • UI
  • Misc
  • Cloud

Avoid creating unnecessary objects

Posted on April 22, 2018

Just don’t do it.

  • Don’t create new strings
  • Don’t instantiate resource heavy classes in a loop
  • Mind the unnecessary auto-boxing
  • Make use of static fields or caching
  • Make use of singleton pattern
  • Opt for immutable objects and reuse them.

This post is based on Joshua Bloch Effective Java Third Edition (get it on Amazon: https://www.amazon.com/Effective-Java-3rd-Joshua-Bloch/dp/0134685997)

Post navigation

← Prefer dependency injection to hard wiring resources Eliminate obsolete objects references →

Tags

adapter pattern BEM book bridge pattern build management cloud composition concurreny creating destroying objects CSS decorator pattern dependency injection deployment design patterns earth effective java factory pattern goldilocks gradle groovy HTML.naming interview question invokedynamic java java7 java8 javascript jvm leadership leaflet.js life linux migration programming patterns proxy pattern react reflection singleton strategy pattern system architecture system design technical UI UX web

5 Minutes Tech and mintfrost.com brought to you by toborowicz.pl


Recent Posts

  • Useful linux commands that you always forget
  • Next step in the journey
  • Strangler pattern
  • Deployment scenarios
  • Free embedded map API for web

Archives

  • November 2020
  • May 2020
  • April 2020
  • February 2020
  • September 2019
  • March 2019
  • May 2018
  • April 2018
  • March 2018
  • February 2018
  • January 2018
Proudly powered by WordPress | Theme: techism by Rajeeb Banstola.