CodeX
Published in

CodeX

Effective Java: Use Lazy Initialization Judiciously

Photo by Adrian Swancar on Unsplash

Lazy initialization is the pattern of putting off the creation of an object or process until it is needed. The idea behind this pattern is that you may never need the object and thus you will have saved the initialization costs. The main reason that lazy initialization is used is as an optimization. The other use that lazy initialization has is breaking tricky circular dependencies in your code.

Everything connected with Tech & Code. Follow to join our 900K+ monthly readers

Recommended from Medium

CRM in Higher Education: The Secret Guide

ⲶLIST Last Chance

Mac Xcode and C++ — File Handling

A detailed explanation of the compiler GCC stages for rookies

Solving the problem of inheritance in C#

Tombstones in Apache Cassandra

Tips for Software Engineer Students at Flatiron School

Conversion of Text to CSV

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Kyle Carter

Kyle Carter

I'm a software architect that has a passion for software design and sharing with those around me

More from Medium

Effective Java: Consider Serialization Proxies Instead of Serialized Instances

Avoid Java errors and mistakes. DMN to call Java.

3 Terrible Java Snippets You Should See

Java 11 features