terminal

codeando_simple

terminal

menu

terminal

search_module

guest@codeandosimple: ~/system/search $ grep -r "" .

Press [ENTER] to execute search

Status

Engine: Ready

Database: Online

Index: V2.1.0_LATEST

bash -- cat lazy-load.md
guest@codeandosimple: ~/enterprise/patterns $ cat lazy-load.md

Lazy Load_

// "Loading only what you need, when you need it"

**Lazy Load** is a design pattern that delays the initialization of an object or the loading of its data until the moment it is actually accessed for the first time.

It is extremely useful in enterprise applications where objects often have complex relationships. Loading the entire object graph all at once can be extremely costly in terms of memory and time.

# Types of Lazy Loading

Virtual Proxy

An object that looks like the real object but does not contain data until one of its methods is called.

Ghost

The object exists but is empty (only has its ID). It fills itself when queried.

# Why is it important?

It allows keeping the application reactive and efficient. If you have a `User` object with 10,000 `Orders`, Lazy Load avoids loading those 10,000 orders unless the software actually tries to read that user's order list.