Questions tagged [lazy-initialization]
The lazy-initialization tag has no summary.
4 questions
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?
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 ...
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 ...
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 ...