Re: [lang] LazyInitializer

2009-10-26 Thread Stephen Colebourne
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

Re: [lang] LazyInitializer

2009-10-25 Thread Oliver Heger
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.

Re: [lang] LazyInitializer

2009-10-25 Thread Stephen Colebourne
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

Re: [lang] LazyInitializer

2009-10-24 Thread Oliver Heger
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

[lang] LazyInitializer

2009-10-24 Thread Stephen Colebourne
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