mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-05-15 18:59:10 +00:00
#108 Consistent package naming throughout the examples
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
package com.iluwatar.lazy.loading;
|
||||
|
||||
/**
|
||||
*
|
||||
* Simple implementation of the lazy loading idiom.
|
||||
* However, this is not thread safe.
|
||||
*
|
||||
*/
|
||||
public class HolderNaive {
|
||||
|
||||
private Heavy heavy;
|
||||
|
||||
public HolderNaive() {
|
||||
System.out.println("HolderNaive created");
|
||||
}
|
||||
|
||||
public Heavy getHeavy() {
|
||||
if (heavy == null) {
|
||||
heavy = new Heavy();
|
||||
}
|
||||
return heavy;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user