Hello Lazy Loading

Due to popular demand, I will post a very short version of my Lazy Loading article:


Because this is bad:

This is good:

And this is better:

Where getChildSum() is:


Using Java 1.3 Dynamic Proxies (interfaces only)

Using cglib (also classes)

Testing (example with EasyMock)

Please note that like all internal-testing test cases, this one is pretty fragile to changes.

About Johannes Brodwall

Johannes is Principal Software Engineer in SopraSteria. In his spare time he likes to coach teams and developers on better coding, collaboration, planning and product understanding.
This entry was posted in Java, Software Development. Bookmark the permalink.