Skip to main content

Questions tagged [lazy-initialization]

37votes
6answers
22kviews

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?
John Smith's user avatar
8votes
1answer
1kviews

Is there a name for the counterpart of the lazy loading pattern?

Definition of the lazy loading pattern from Wikipedia: Lazy loading is a design pattern commonly used in computer programming to defer initialization of an object until the point at which it is ...
R Sahu's user avatar
  • 2,016
4votes
1answer
467views

Is it ever appropriate to lazy load properties?

Consider the following contrived program: class Program { static void Main(string[] args) { var myClass = new MyClass(); var stuff = myClass.MyProperty; // this takes 5 ...
Will Ray's user avatar
3votes
1answer
879views

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 ...
tunmise fasipe's user avatar

close