Oliver Heger wrote:
Do you think that a generic implementation of the lazy initialization
pattern has such an impact on performance?
In a typical implementation you would add the initializer as a final
member field to a class:
public class MyClass {
private final MyConcreteLazyInitialize
Stephen Colebourne schrieb:
Oliver Heger wrote:
The lazy initialization holder class idiom only applies for static
fields of a class. The LazyInitializer class uses the double-check
idiom and is intended for lazy initialization of instance fields. So
there may be different use cases for it.
Oliver Heger wrote:
The lazy initialization holder class idiom only applies for static
fields of a class. The LazyInitializer class uses the double-check idiom
and is intended for lazy initialization of instance fields. So there may
be different use cases for it.
Maybe this fact can be better
Stephen Colebourne schrieb:
I believe that we should remove this class.
The class performs no useful purpose, as there is a better way to use a
separate class to create a value lazily:
// Lazy initialization holder class idiom for static fields
private static class FieldHolder {
static f
I believe that we should remove this class.
The class performs no useful purpose, as there is a better way to use a
separate class to create a value lazily:
// Lazy initialization holder class idiom for static fields
private static class FieldHolder {
static final FieldType field = comput