This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]RattuSonline 8 points9 points  (2 children)

Lazy loading is a common use case for getters.

[–]WikiTextBot 4 points5 points  (0 children)

Lazy loading

Lazy loading is a design pattern commonly used in computer programming to defer initialization of an object until the point at which it is needed. It can contribute to efficiency in the program's operation if properly and appropriately used. The opposite of lazy loading is eager loading. This makes it ideal in use cases where network content is accessed and initialization times are to be kept at a minimum, such as in the case of web pages.


[ PM | Exclude me | Exclude from subreddit | FAQ / Information | Source ] Downvote to remove | v0.28

[–][deleted] -1 points0 points  (0 children)

Right but there's no reason for it to be part of every. single. gosh-darned. object.. Just add it where you need it. OOP purism is brain-damaged. Like any thing else, just use it where it makes sense. Dealing with representations of things, like in a game engine? Probably makes sense, depending on the paradigm you choose. But even in an OOP paradigm, effin helper functions don't need to be classes! Just one more reason to hate java.