Tagged Questions

The tag has no wiki summary.

learn more… | top users | synonyms

4
votes
1answer
209 views

Does laziness yield more race conditions?

I recently ran into a race condition while accessing a configuration setting. After examining what I could of the code, I came to the conclusion that the Configuration class' laziness1 was the source ...
-1
votes
2answers
116 views

Is 'lazy' the correct term for timestamp-based skipping? [closed]

(1) The oldmakeutility looks at timestamps, and if the output is newer than the input, it skips (pointless, time-consuming) re-compilation of e.g. C files. The same is true for many languages and ...
0
votes
1answer
57 views

Lazy-initialization vs preprocessing in image-based iOS app

I am making an iOS app which contains museum gallery: user can look through exhibits and then select info about it, etc. On the exhibit screen I have two ScrollViews that are different, but are being ...
2
votes
0answers
454 views

Entity Framework - Loading Related Entities Explicitly

I have been using Entity Framework for a few years. I have flip-flopped between calling out to repositories in my business logic or using lazy loading to retrieve data as I work my way through the ...
0
votes
0answers
90 views

Succinct Lazy Initialization Pattern

Background I often use the following lazy initialization pattern: public class Clazz { private Object object; private Object getObject() { Object object = this.object; if( object == ...
0
votes
0answers
98 views

Design of a custom query result array with lazy loading

I have a database that generates a query result array, each position of the array being a hash like object. Since each array item must be mapped into a well defined class, I decided to implement an ...
2
votes
2answers
187 views

Lazy loading if collection would have any entries

I often see model classes with properties like this: public IList<Note> Notes { get; set; } public bool HasNotes { get; set; } Where the list is initialized lazy, but the boolean property is ...
2
votes
1answer
399 views

Why does this static field always get initialized over-eagerly?

I am looking at this excellent article from Jon Skeet. While executing the demo code, Jon Skeet says that we can expect three different kinds of behaviours. To quote that article: The runtime ...
3
votes
1answer
516 views

Lazy loading can lead to stale data, violates IoC?

Trying to be a better programmer I have an application that keeps track of Roles and Permissions, I had classes for Role and Permission which were just value objects. class Role { int RoleID ...
14
votes
4answers
4k views

Why isn't lazy evaluation used everywhere?

I've just learnt how lazy evaluation works and I was wondering: why isn't lazy evaluation applied in every software currently produced? Why still using eager evaluation?
5
votes
4answers
899 views

What is a good pattern for combined caching and reinitialization?

I have a situation where I have three requirements: Lazy initialization - don't create the collection until asked for it Caching - keep the collection in memory on the object Reinitialization - be ...
9
votes
4answers
972 views

Is there any reason lazy initialization couldn't be built into Java?

Since I'm working on a server with absolutely no non-persisted state for users, every User-related object we have is rolled out on every request. Consequently I often find myself doing lazy ...
1
vote
1answer
340 views

WPF: Reloading app parts to handle persistence as well as memory management

I created a app using Microsoft's WPF. It mostly handles data reading and input as well as associating relations between data within specific parameters. As a total beginner I made some bad design ...